New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
streamingccl: add EXPIRATION WINDOW option to ALTER VIRTUAL CLUSTER #117776
streamingccl: add EXPIRATION WINDOW option to ALTER VIRTUAL CLUSTER #117776
Conversation
Epic: none Release note: none
e5c7a5b
to
c411be4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for working on this. Left some very minor naming nitpicks and cleanups. Take them or leave them.
md.Progress.GetStreamReplication().Expiration = newExpiration | ||
ju.UpdateProgress(md.Progress) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This might be more than we want to chew in this PR, but I'm mildly of the opinion that the builtin really should be saving the LastCheckinTime
rather than the expiration.
// We don't allow the user to specify the producer job expirationWindow during | ||
// replication creation from the destination cluster, as this job setting | ||
// should only be set from the producer cluster. | ||
return nil, nil, nil, false, errors.New("cannot specify expirationWindow option while starting a physical replication stream") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe: s/expirationWindow option/the EXPIRATION WINDOW option/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not necessarily for this PR, but I wonder if we should allow them to set the expiration window here and then the expiration set here would be used on the producer job we created post cutover, failing back to the retention window if it is is unset. But, I suppose then there would be confusion about why that doesn't also set the expiration window on the producer job on the source.
if !alterTenantStmt.Options.IsDefault() { | ||
return alterTenantSetReplication(ctx, p.InternalSQLTxn(), jobRegistry, options, tenInfo) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not really your problem but this and the last couple of changes have moved this function from one in which all of the possible commands were handled in the if/else block below into one where some are handled above with early returns and some are handled below with early returns.
If we find ourselves modifying this again it might be nice to clean up.
Previously, the private `stream_replication.job_liveness_timeout` cluster setting determined how long the producer job would stay alive without a hearbeat from the consumer job. This patch removes this setting, and adds new sql syntax so the user can set this timeout on for all producer jobs on the given tenant. Epic: CRDB-34233 Release note (sql change): This patch adds the new EXPIRATION WINDOW option set through `ALTER TENANT appTenant SET REPLICATION EXPIRATION WINDOW ='100ms'`, which allows the user to override the default producer job expiration window of 24 hours. The producer job expiration window determines how long the producer job stays alive without a heartbeat from the consumer job.
c411be4
to
de0265a
Compare
TFTR! bors r=stevendanna |
Build succeeded: |
Previously, the private
stream_replication.job_liveness_timeout
clustersetting determined how long the producer job would stay alive without a
hearbeat from the consumer job. This patch removes this setting, and adds new
sql syntax so the user can set this timeout on for all producer jobs on the
given tenant.
Epic: CRDB-34233
Release note (sql change): This patch adds the new EXPIRATION WINDOW option set
through
ALTER TENANT appTenant SET REPLICATION EXPIRATION WINDOW ='100ms'
,which allows the user to override the default producer job expiration window of
24 hours. The producer job expiration window determines how long the producer
job stays alive without a heartbeat from the consumer job.