Skip to content

Commit bae95e3

Browse files
committed
sql: stop setting readAsOf in index backfiller
As of the parent commit, this is unused by the index backfiller. Release note: None
1 parent bf69a61 commit bae95e3

File tree

4 files changed

+5
-9
lines changed

4 files changed

+5
-9
lines changed

pkg/sql/backfill.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1012,8 +1012,6 @@ func (sc *SchemaChanger) distIndexBackfill(
10121012
log.Infof(ctx, "writing at persisted safe write time %v...", writeAsOf)
10131013
}
10141014

1015-
readAsOf := sc.clock.Now()
1016-
10171015
var p *PhysicalPlan
10181016
var extEvalCtx extendedEvalContext
10191017
var planCtx *PlanningCtx
@@ -1045,7 +1043,7 @@ func (sc *SchemaChanger) distIndexBackfill(
10451043
)
10461044
indexBatchSize := indexBackfillBatchSize.Get(&sc.execCfg.Settings.SV)
10471045
chunkSize := sc.getChunkSize(indexBatchSize)
1048-
spec, err := initIndexBackfillerSpec(*tableDesc.TableDesc(), writeAsOf, readAsOf, writeAtRequestTimestamp, chunkSize, addedIndexes, 0 /* sourceIndexID*/)
1046+
spec, err := initIndexBackfillerSpec(*tableDesc.TableDesc(), writeAsOf, writeAtRequestTimestamp, chunkSize, addedIndexes, 0)
10491047
if err != nil {
10501048
return err
10511049
}

pkg/sql/distsql_plan_backfill.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ func initColumnBackfillerSpec(
4040

4141
func initIndexBackfillerSpec(
4242
desc descpb.TableDescriptor,
43-
writeAsOf, readAsOf hlc.Timestamp,
43+
writeAsOf hlc.Timestamp,
4444
writeAtBatchTimestamp bool,
4545
chunkSize int64,
4646
indexesToBackfill []descpb.IndexID,
@@ -50,7 +50,6 @@ func initIndexBackfillerSpec(
5050
Table: desc,
5151
WriteAsOf: writeAsOf,
5252
WriteAtBatchTimestamp: writeAtBatchTimestamp,
53-
ReadAsOf: readAsOf,
5453
Type: execinfrapb.BackfillerSpec_Index,
5554
ChunkSize: chunkSize,
5655
IndexesToBackfill: indexesToBackfill,

pkg/sql/execinfrapb/processors_bulk_io.proto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,9 @@ message BackfillerSpec {
6161
optional uint64 update_chunk_size_threshold_bytes = 14 [(gogoproto.nullable) = false];
6262

6363
// WriteAsOf is the time that the backfill entries should be written.
64-
// Note: Older nodes may also use this as the read time instead of readAsOf.
6564
optional util.hlc.Timestamp writeAsOf = 7 [(gogoproto.nullable) = false];
6665
// The timestamp to perform index backfill historical scans at.
66+
// This is only used by the column backfiller.
6767
optional util.hlc.Timestamp readAsOf = 9 [(gogoproto.nullable) = false];
6868

6969
// IndexesToBackfill is the set of indexes to backfill. This is populated only

pkg/sql/index_backfiller.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -184,9 +184,8 @@ func (ib *IndexBackfillPlanner) plan(
184184
chunkSize := indexBackfillBatchSize.Get(&ib.execCfg.Settings.SV)
185185
const writeAtRequestTimestamp = true
186186
spec, err := initIndexBackfillerSpec(
187-
*td.TableDesc(), writeAsOf, readAsOf, writeAtRequestTimestamp, chunkSize,
188-
indexesToBackfill,
189-
sourceIndexID,
187+
*td.TableDesc(), writeAsOf, writeAtRequestTimestamp, chunkSize,
188+
indexesToBackfill, sourceIndexID,
190189
)
191190
if err != nil {
192191
return err

0 commit comments

Comments
 (0)