From 397537783b4cdb2465c23bbcc5f5370f0f441d65 Mon Sep 17 00:00:00 2001 From: radekg Date: Fri, 3 Dec 2021 02:59:25 +0100 Subject: [PATCH] Fix create snapshot for YSQL databases --- client/implementation/op_snapshots_create.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/client/implementation/op_snapshots_create.go b/client/implementation/op_snapshots_create.go index 503f322..72b9d15 100644 --- a/client/implementation/op_snapshots_create.go +++ b/client/implementation/op_snapshots_create.go @@ -110,7 +110,10 @@ func createSnapshotYSQL(c *defaultYBCliClient, opConfig *configs.OpSnapshotCreat tableIdentifiers := []*ybApi.TableIdentifierPB{} for _, tableInfo := range tablesPayload.Tables { tableIdentifiers = append(tableIdentifiers, &ybApi.TableIdentifierPB{ + // https://github.com/yugabyte/yugabyte-db/blob/d4d5688147734d1a36bbe58430f35ba4db2770f1/ent/src/yb/tools/yb-admin_client_ent.cc#L275 TableId: tableInfo.Id, + // https://github.com/yugabyte/yugabyte-db/blob/d4d5688147734d1a36bbe58430f35ba4db2770f1/ent/src/yb/tools/yb-admin_client_ent.cc#L276 + Namespace: tableInfo.Namespace, }) } @@ -120,6 +123,13 @@ func createSnapshotYSQL(c *defaultYBCliClient, opConfig *configs.OpSnapshotCreat v := false return &v }(), + // CreateSnapshot called from https://github.com/yugabyte/yugabyte-db/blob/d4d5688147734d1a36bbe58430f35ba4db2770f1/ent/src/yb/tools/yb-admin_client_ent.cc#L288 + // and always sets transaction aware to true: + // https://github.com/yugabyte/yugabyte-db/blob/d4d5688147734d1a36bbe58430f35ba4db2770f1/ent/src/yb/tools/yb-admin_client_ent.cc#L247 + TransactionAware: func() *bool { + v := true + return &v + }(), } responsePayload := &ybApi.CreateSnapshotResponsePB{}