Skip to content

Commit

Permalink
Fix create snapshot for YSQL databases
Browse files Browse the repository at this point in the history
  • Loading branch information
radekg committed Dec 3, 2021
1 parent d654563 commit 3975377
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions client/implementation/op_snapshots_create.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
})
}

Expand All @@ -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{}
Expand Down

0 comments on commit 3975377

Please sign in to comment.