Skip to content

Commit

Permalink
remove checks for external tables in queued backup
Browse files Browse the repository at this point in the history
We've moved all external tables check from backup data routines
in 76830c6. There is new routine
to backup into single data file with a connection queue implemented
in 5925c1e. So remove checks from
this new routine to as useless.

Co-authored-by: Polina Bungina <[email protected]>
  • Loading branch information
Stolb27 and hughcapet committed Dec 14, 2021
1 parent ff86861 commit 39cc1e8
Showing 1 changed file with 1 addition and 13 deletions.
14 changes: 1 addition & 13 deletions backup/data.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,13 +120,7 @@ func BackupSingleTableData(table Table, rowsCopiedMap map[uint32]int64, counters
// workers encounter locking issues. Worker 0 already has all locks on the
// tables so it will not run into locking issues.
func backupDataForAllTablesCopyQueue(tables []Table) []map[uint32]int64 {
var numExtOrForeignTables int64
for _, table := range tables {
if table.SkipDataBackup() {
numExtOrForeignTables++
}
}
counters := BackupProgressCounters{NumRegTables: 0, TotalRegTables: int64(len(tables)) - numExtOrForeignTables}
counters := BackupProgressCounters{NumRegTables: 0, TotalRegTables: int64(len(tables))}
counters.ProgressBar = utils.NewProgressBar(int(counters.TotalRegTables), "Tables backed up: ", utils.PB_INFO)
counters.ProgressBar.Start()
rowsCopiedMaps := make([]map[uint32]int64, connectionPool.NumConns)
Expand Down Expand Up @@ -158,11 +152,6 @@ func backupDataForAllTablesCopyQueue(tables []Table) []map[uint32]int64 {
return
}

if table.SkipDataBackup() {
gplog.Verbose("Skipping data backup of table %s because it is either an external or foreign table.", table.FQN())
oidMap.Store(table.Oid, Complete)
continue
}
// If a random external SQL command had queued an AccessExclusiveLock acquisition request
// against this next table, the --job worker thread would deadlock on the COPY attempt.
// To prevent gpbackup from hanging, we attempt to acquire an AccessShareLock on the
Expand Down Expand Up @@ -261,7 +250,6 @@ func backupDataForAllTablesCopyQueue(tables []Table) []map[uint32]int64 {
}

counters.ProgressBar.Finish()
printDataBackupWarnings(numExtOrForeignTables)
return rowsCopiedMaps
}

Expand Down

0 comments on commit 39cc1e8

Please sign in to comment.