Skip to content

Commit d02450c

Browse files
committed
ttljob: make an error message slightly more helpful
The new message assures the user that the job will run again. Release note: None
1 parent 2dab378 commit d02450c

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

pkg/sql/ttl/ttljob/ttljob.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ func (t rowLevelTTLResumer) Resume(ctx context.Context, execCtx interface{}) (re
9494
if modificationTime.After(aost) {
9595
return pgerror.Newf(
9696
pgcode.ObjectNotInPrerequisiteState,
97-
"found a recent schema change on the table at %s, aborting",
97+
"found a recent schema change on the table at %s, job will run at the next scheduled time",
9898
modificationTime.Format(time.RFC3339),
9999
)
100100
}

pkg/sql/ttl/ttljob/ttljob_processor.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -447,7 +447,7 @@ func (t *ttlProcessor) runTTLOnQueryBounds(
447447
}
448448
if ttlSpec.PreDeleteChangeTableVersion || desc.GetVersion() != details.TableVersion {
449449
return errors.Newf(
450-
"table has had a schema change since the job has started at %s, aborting",
450+
"table has had a schema change since the job has started at %s, job will run at the next scheduled time",
451451
desc.GetModificationTime().GoTime().Format(time.RFC3339),
452452
)
453453
}

pkg/sql/ttl/ttljob/ttljob_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -318,12 +318,12 @@ INSERT INTO t (id, crdb_internal_expiration) VALUES (1, now() - '1 month'), (2,
318318
}{
319319
{
320320
desc: "schema change too recent to start TTL job",
321-
expectedTTLError: "found a recent schema change on the table at .*, aborting",
321+
expectedTTLError: "found a recent schema change on the table at .*, job will run at the next scheduled time",
322322
aostDuration: -48 * time.Hour,
323323
},
324324
{
325325
desc: "schema change during job",
326-
expectedTTLError: "error during row deletion: table has had a schema change since the job has started at .*, aborting",
326+
expectedTTLError: "error during row deletion: table has had a schema change since the job has started at .*, job will run at the next scheduled time",
327327
aostDuration: zeroDuration,
328328
// We cannot use a schema change to change the version in this test as
329329
// we overtook the job adoption method, which means schema changes get

0 commit comments

Comments
 (0)