Skip to content

Commit

Permalink
Merge #71754 #72280
Browse files Browse the repository at this point in the history
71754: backupccl: remove some used code r=adityamaru a=stevendanna

The baseURI variable was used by a function call that was removed in
28e4cea. The TODO still seems
relevant.

Release note: None

72280: sql: clarify !IsCanonical path wrt scan.ExactPrefix r=cucaroach a=cucaroach

Passing scan.ExactPrefix with other indexes is a little confusing, make
it clear that for non-canonical scans exactPrefix will always be zero.

Release note: None

Co-authored-by: Steven Danna <[email protected]>
Co-authored-by: Tommy Reilly <[email protected]>
  • Loading branch information
3 people committed Nov 2, 2021
3 parents 3f56647 + f2b1ca4 + eba7c0e commit a8d8676
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
9 changes: 3 additions & 6 deletions pkg/ccl/backupccl/backup_planning.go
Original file line number Diff line number Diff line change
Expand Up @@ -1160,19 +1160,16 @@ func backupPlanHook(
if err := checkForPreviousBackup(ctx, defaultStore, defaultURI); err != nil {
return err
}
// TODO (pbardea): For partitioned backups, also add verification for other
// stores we are writing to in addition to the default.
baseURI := collectionURI
if baseURI == "" {
baseURI = defaultURI
}

// Write backup manifest into a temporary checkpoint file.
// This accomplishes 2 purposes:
// 1. Persists large state needed for backup job completion.
// 2. Verifies we can write to destination location.
// This temporary checkpoint file gets renamed to real checkpoint
// file when the backup jobs starts execution.
//
// TODO (pbardea): For partitioned backups, also add verification for other
// stores we are writing to in addition to the default.
doWriteBackupManifestCheckpoint := func(ctx context.Context, jobID jobspb.JobID) error {
if err := writeBackupManifest(
ctx, p.ExecCfg().Settings, defaultStore, tempCheckpointFileNameForJob(jobID),
Expand Down
3 changes: 2 additions & 1 deletion pkg/sql/opt/ordering/interesting_orderings.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,8 @@ func interestingOrderingsForScan(scan *memo.ScanExpr) props.OrderingSet {
// the table's indexes. Add orderings for all of them.
ord = make(props.OrderingSet, 0, tab.IndexCount())
for i := 0; i < tab.IndexCount(); i++ {
addIndexOrdering(i, &scan.Relational().FuncDeps, scan.ExactPrefix)
// IsCanonical implies no constraints so exactPrefix is 0.
addIndexOrdering(i, &scan.Relational().FuncDeps, 0)
}
} else {
// This scan is not canonical, so we can only use the ordering implied by
Expand Down

0 comments on commit a8d8676

Please sign in to comment.