diff --git a/pkg/jobs/jobspb/jobs.proto b/pkg/jobs/jobspb/jobs.proto index c4cf652782f1..e115bbea0f87 100644 --- a/pkg/jobs/jobspb/jobs.proto +++ b/pkg/jobs/jobspb/jobs.proto @@ -1188,8 +1188,8 @@ message RowLevelTTLDetails { message RowLevelTTLProgress { - // JobRowCount is the number of deleted rows for the entire TTL job. - int64 job_row_count = 1; + // JobDeletedRowCount is the number of rows deleted by TTL job so far. + int64 job_deleted_row_count = 1; // ProcessorProgresses is the progress per DistSQL processor. repeated RowLevelTTLProcessorProgress processor_progresses = 2 [(gogoproto.nullable)=false]; diff --git a/pkg/sql/ttl/ttljob/ttljob_processor.go b/pkg/sql/ttl/ttljob/ttljob_processor.go index 70f88fde6b82..733ec1f871b3 100644 --- a/pkg/sql/ttl/ttljob/ttljob_processor.go +++ b/pkg/sql/ttl/ttljob/ttljob_processor.go @@ -281,7 +281,7 @@ func (t *ttlProcessor) work(ctx context.Context) error { progress.Progress = &jobspb.Progress_FractionCompleted{ FractionCompleted: fractionCompleted, } - rowLevelTTL.JobRowCount += rowsDeletedSoFar.Load() + rowLevelTTL.JobDeletedRowCount += rowsDeletedSoFar.Load() rowLevelTTL.JobProcessedSpanCount += spansProccessedSoFar.Load() rowLevelTTL.ProcessorProgresses = append(rowLevelTTL.ProcessorProgresses, jobspb.RowLevelTTLProcessorProgress{ ProcessorID: processorID, @@ -295,7 +295,7 @@ func (t *ttlProcessor) work(ctx context.Context) error { ctx, 2, /* level */ "TTL processorRowCount updated processorID=%d sqlInstanceID=%d tableID=%d jobRowCount=%d processorRowCount=%d fractionCompleted=%.3f", - processorID, sqlInstanceID, tableID, rowLevelTTL.JobRowCount, rowsDeletedSoFar.Load(), fractionCompleted, + processorID, sqlInstanceID, tableID, rowLevelTTL.JobDeletedRowCount, rowsDeletedSoFar.Load(), fractionCompleted, ) return nil }, diff --git a/pkg/sql/ttl/ttljob/ttljob_test.go b/pkg/sql/ttl/ttljob/ttljob_test.go index 4517e537546d..2a1c0e46287e 100644 --- a/pkg/sql/ttl/ttljob/ttljob_test.go +++ b/pkg/sql/ttl/ttljob/ttljob_test.go @@ -214,7 +214,7 @@ func (h *rowLevelTTLTestJobTestHelper) verifyExpiredRowsJobOnly( var progress jobspb.Progress require.NoError(t, protoutil.Unmarshal(progressBytes, &progress)) - actualNumExpiredRows := progress.UnwrapDetails().(jobspb.RowLevelTTLProgress).JobRowCount + actualNumExpiredRows := progress.UnwrapDetails().(jobspb.RowLevelTTLProgress).JobDeletedRowCount require.Equal(t, int64(expectedNumExpiredRows), actualNumExpiredRows) jobCount++ } @@ -272,7 +272,7 @@ func (h *rowLevelTTLTestJobTestHelper) verifyExpiredRows( } require.Equal(t, expectedJobSpanCount, rowLevelTTLProgress.JobProcessedSpanCount) require.Equal(t, expectedJobSpanCount, rowLevelTTLProgress.JobTotalSpanCount) - require.Equal(t, expectedJobRowCount, rowLevelTTLProgress.JobRowCount) + require.Equal(t, expectedJobRowCount, rowLevelTTLProgress.JobDeletedRowCount) jobCount++ } require.Equal(t, 1, jobCount)