@@ -73,7 +73,7 @@ func (t *ttlProcessor) Start(ctx context.Context) {
7373}
7474
7575func getTableInfo (
76- ctx context.Context , db descs.DB , descsCol * descs. Collection , tableID descpb.ID ,
76+ ctx context.Context , db descs.DB , tableID descpb.ID ,
7777) (
7878 relationName string ,
7979 pkColIDs catalog.TableColMap ,
@@ -84,8 +84,8 @@ func getTableInfo(
8484 labelMetrics bool ,
8585 err error ,
8686) {
87- err = db .Txn (ctx , func (ctx context.Context , txn isql .Txn ) error {
88- desc , err := descsCol .ByIDWithLeased (txn .KV ()).WithoutNonPublic ().Get ().Table (ctx , tableID )
87+ err = db .DescsTxn (ctx , func (ctx context.Context , txn descs .Txn ) error {
88+ desc , err := txn . Descriptors () .ByIDWithLeased (txn .KV ()).WithoutNonPublic ().Get ().Table (ctx , tableID )
8989 if err != nil {
9090 return err
9191 }
@@ -116,7 +116,7 @@ func getTableInfo(
116116 rowLevelTTL := desc .GetRowLevelTTL ()
117117 labelMetrics = rowLevelTTL .LabelMetrics
118118
119- tn , err := descs .GetObjectName (ctx , txn .KV (), descsCol , desc )
119+ tn , err := descs .GetObjectName (ctx , txn .KV (), txn . Descriptors () , desc )
120120 if err != nil {
121121 return errors .Wrapf (err , "error fetching table relation name for TTL" )
122122 }
@@ -133,7 +133,6 @@ func (t *ttlProcessor) work(ctx context.Context) error {
133133 flowCtx := t .FlowCtx
134134 serverCfg := flowCtx .Cfg
135135 db := serverCfg .DB
136- descsCol := flowCtx .Descriptors
137136 codec := serverCfg .Codec
138137 details := ttlSpec .RowLevelTTLDetails
139138 tableID := details .TableID
@@ -161,7 +160,7 @@ func (t *ttlProcessor) work(ctx context.Context) error {
161160 )
162161
163162 relationName , pkColIDs , pkColNames , pkColTypes , pkColDirs , numFamilies , labelMetrics , err := getTableInfo (
164- ctx , db , descsCol , tableID ,
163+ ctx , db , tableID ,
165164 )
166165 if err != nil {
167166 return err
@@ -430,7 +429,7 @@ func (t *ttlProcessor) runTTLOnQueryBounds(
430429 }
431430 deleteBatch := expiredRowsPKs [startRowIdx + processed : until ]
432431 var batchRowCount int64
433- do := func (ctx context.Context , txn isql .Txn ) error {
432+ do := func (ctx context.Context , txn descs .Txn ) error {
434433 txn .KV ().SetDebugName ("ttljob-delete-batch" )
435434 // We explicitly specify a low retry limit because this operation is
436435 // wrapped with its own retry function that will also take care of
@@ -442,7 +441,7 @@ func (t *ttlProcessor) runTTLOnQueryBounds(
442441 }
443442 // If we detected a schema change here, the DELETE will not succeed
444443 // (the SELECT still will because of the AOST). Early exit here.
445- desc , err := flowCtx .Descriptors .ByIDWithLeased (txn .KV ()).WithoutNonPublic ().Get ().Table (ctx , details .TableID )
444+ desc , err := txn .Descriptors () .ByIDWithLeased (txn .KV ()).WithoutNonPublic ().Get ().Table (ctx , details .TableID )
446445 if err != nil {
447446 return err
448447 }
@@ -458,7 +457,7 @@ func (t *ttlProcessor) runTTLOnQueryBounds(
458457 }
459458 return nil
460459 }
461- if err := serverCfg .DB .Txn (
460+ if err := serverCfg .DB .DescsTxn (
462461 ctx , do , isql .SteppingEnabled (), isql .WithPriority (admissionpb .BulkLowPri ),
463462 ); err != nil {
464463 return errors .Wrapf (err , "error during row deletion" )
0 commit comments