Skip to content

Commit

Permalink
ttljob: rename a field in the progress struct
Browse files Browse the repository at this point in the history
Release note: None
  • Loading branch information
rafiss committed Nov 15, 2024
1 parent 0423a63 commit db0e0a7
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions pkg/jobs/jobspb/jobs.proto
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down
4 changes: 2 additions & 2 deletions pkg/sql/ttl/ttljob/ttljob_processor.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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
},
Expand Down
4 changes: 2 additions & 2 deletions pkg/sql/ttl/ttljob/ttljob_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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++
}
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit db0e0a7

Please sign in to comment.