schemachanger: support metadata-only TTL parameters and ttl_job_cron
See individual commits.
schemachanger: handle basic TTL params
The builder was updated so that it modifies the scpb.RowLevelTTL element for when handling TTL storage params. This is needed so that we can do proper validation on the TTL params, since the validation logic checks dependencies between different parameters.
The UpsertRowLevelTTL immediate mutation takes care of modifying the descriptor. Logic was also needed to avoid dropping the TTL schedule if we are modifying parameters.
schemachanger: support ttl_job_cron parameter in declarative schema changer
Previously, modifying the ttl_job_cron storage parameter required falling back to the legacy schema changer because the declarative schema changer had no mechanism to update the TTL scheduled job's cron expression.
This commit adds support for ttl_job_cron by:
-
Adding UpdateTTLScheduleCron as a new deferred mutation operation that updates the cron expression on the existing TTL scheduled job.
-
Implementing findOldTTLCron in opgen to detect when the cron expression has changed by comparing the new RowLevelTTL element against the one being dropped, emitting UpdateTTLScheduleCron only when necessary.
-
Adding UpdateTTLScheduleCron to metadataUpdater which loads the scheduled job, updates its cron expression, and persists the change.
informs: https://github.com/cockroachdb/cockroach/issues/122379 Release note: None
TFTR!
bors r+