Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ADBDEV-6641-ws #115

Closed
wants to merge 31 commits into from
Closed
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
fbba35b
rework
RekGRpth Nov 12, 2024
934657e
fix
RekGRpth Nov 12, 2024
8448381
fix
RekGRpth Nov 12, 2024
6d6d64d
fix
RekGRpth Nov 12, 2024
d7d9dcd
optimize
RekGRpth Nov 13, 2024
c3cbd73
move
RekGRpth Nov 13, 2024
99885ff
partial restore
RekGRpth Nov 13, 2024
62a594c
rework solutiuon
RekGRpth Nov 13, 2024
9a9db2e
optimize and simplify
RekGRpth Nov 14, 2024
e19a15f
remove context
RekGRpth Nov 14, 2024
a30092d
fix tests
RekGRpth Nov 14, 2024
c5dd6db
rm
RekGRpth Nov 14, 2024
e877156
rm
RekGRpth Nov 14, 2024
5181a10
stabellize test
RekGRpth Nov 15, 2024
1907c3c
signal pipe instead open/close
RekGRpth Nov 15, 2024
e48b73f
Merge branch 'ADBDEV-6641' into ADBDEV-6641-ws
RekGRpth Nov 15, 2024
2a83c5b
update log messages
RekGRpth Nov 15, 2024
a1628ea
restore contexts
RekGRpth Nov 15, 2024
8a94b59
simplify
RekGRpth Nov 15, 2024
0ec3e89
Merge branch 'ADBDEV-6641' into ADBDEV-6641-ws
RekGRpth Nov 15, 2024
9fb4727
stabellize test
RekGRpth Nov 15, 2024
484b242
open/close
RekGRpth Nov 15, 2024
5fe1f3c
timeout
RekGRpth Nov 15, 2024
62c848d
Merge branch 'ADBDEV-6641' into ADBDEV-6641-ws
RekGRpth Nov 15, 2024
f5330bf
Merge branch 'master' into ADBDEV-6641
RekGRpth Nov 19, 2024
0c9f756
open/close pipe inly if not terminated
RekGRpth Nov 20, 2024
a5e1a93
sigpiped
RekGRpth Nov 20, 2024
9a7ad16
Merge branch 'ADBDEV-6641' into ADBDEV-6641-ws
RekGRpth Nov 20, 2024
13610b8
Merge branch 'master' into ADBDEV-6641-ws
RekGRpth Dec 3, 2024
2aa131e
Merge branch 'master' into ADBDEV-6641-ws
RekGRpth Dec 5, 2024
b9d2001
Merge branch 'master' into ADBDEV-6641-ws
RekGRpth Dec 6, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 3 additions & 7 deletions backup/data.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,6 @@ func BackupDataForAllTables(tables []Table) []map[uint32]int64 {
*/
tasks := make(chan Table, len(tables))
var oidMap sync.Map
var isErroredBackup atomic.Bool
var workerPool sync.WaitGroup
// Record and track tables in a hashmap of oids and table states (preloaded with value Unknown).
// The tables are loaded into the tasks channel for the subsequent goroutines to work on.
Expand Down Expand Up @@ -223,7 +222,7 @@ func BackupDataForAllTables(tables []Table) []map[uint32]int64 {
return // Error somewhere, terminate
default: // Default is must to avoid blocking
}
if wasTerminated.Load() || isErroredBackup.Load() {
if wasTerminated.Load() {
counters.ProgressBar.(*pb.ProgressBar).NotPrint = true
cancel()
return
Expand All @@ -245,7 +244,6 @@ func BackupDataForAllTables(tables []Table) []map[uint32]int64 {
err := LockTableNoWait(table, whichConn)
if err != nil {
if pgErr, ok := err.(*pgconn.PgError); ok && pgErr.Code != PG_LOCK_NOT_AVAILABLE {
isErroredBackup.Store(true)
err = connectionPool.Rollback(whichConn)
if err != nil {
gplog.Warn("Worker %d: %s", whichConn, err)
Expand Down Expand Up @@ -278,7 +276,6 @@ func BackupDataForAllTables(tables []Table) []map[uint32]int64 {
// if copy isn't working, skip remaining backups, and let downstream panic
// handling deal with it
counters.ProgressBar.(*pb.ProgressBar).NotPrint = true
isErroredBackup.Store(true)
gplog.Fatal(err, "")
} else {
oidMap.Store(table.Oid, Complete)
Expand Down Expand Up @@ -313,7 +310,7 @@ func BackupDataForAllTables(tables []Table) []map[uint32]int64 {
return // Error somewhere, terminate
default: // Default is must to avoid blocking
}
if wasTerminated.Load() || isErroredBackup.Load() {
if wasTerminated.Load() {
cancel()
return
}
Expand All @@ -323,7 +320,6 @@ func BackupDataForAllTables(tables []Table) []map[uint32]int64 {
} else if state.(int) == Deferred {
err := BackupSingleTableData(ctx, table, rowsCopiedMaps[0], &counters, 0)
if err != nil {
isErroredBackup.Store(true)
gplog.Fatal(err, "")
}
oidMap.Store(table.Oid, Complete)
Expand Down Expand Up @@ -354,7 +350,7 @@ func BackupDataForAllTables(tables []Table) []map[uint32]int64 {
if backupSnapshot == "" {
allWorkersTerminatedLogged := false
for _, table := range tables {
if wasTerminated.Load() || isErroredBackup.Load() {
if wasTerminated.Load() {
counters.ProgressBar.(*pb.ProgressBar).NotPrint = true
break
}
Expand Down
Loading