Skip to content
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

Workflow Show: use timeUpdated to calculate vreplication lag #7342

Merged
merged 2 commits into from
Jan 23, 2021

Conversation

rohit-nayak-ps
Copy link
Contributor

@rohit-nayak-ps rohit-nayak-ps commented Jan 21, 2021

Signed-off-by: Rohit Nayak rohit@planetscale.com

Description

  1. There was a problem in the initial implementation of determining MaxVReplicationLag, which was the seconds since transaction_timestamp. MaxVReplicationLag is used, in a Reshard workflow, by the operator to determine when resharding is completed. See VReplication stream heartbeats record incorrect event timestamps #6946, which logs the problem and fixes it. However this fix was problematic for two reasons:

    • transaction_timestamp is 0 as long as the stream is in the copy phase. If there are no new writes on the source once the copy phase is completed then the value does not get updated
    • there are cases when there are no writes on the source relevant to a target. In this case the transaction_timestamp column for that stream does not get updated as there are no new events seen by the target.

    In both cases the operator decides that the stream is lagging and doesn't perform the cutover. This PR changes the logic to use the time_updated column instead of transaction_timestamp. time_updated is updated both when there is a binlog event from the source and also when the source sends a heartbeat (every idle second).

  2. Don't display unused column max_replication_lag from _vt.vreplication

    This column was used several versions earlier for throttling SplitClone streams. Vreplication workflows do not use it and it should not be displayed since it always displays MaxInt and is confusing to users.

Related Issue(s)

#6946

Checklist

  • Should this PR be backported?
  • Tests were added or are not required
  • Documentation was added or is not required

Impacted Areas in Vitess

Components that this PR will affect:

  • Query Serving
  • VReplication
  • Cluster Management
  • Build
  • VTAdmin

…ove unused column MaxReplicationLag

Signed-off-by: Rohit Nayak <rohit@planetscale.com>
Signed-off-by: Rohit Nayak <rohit@planetscale.com>
Copy link
Member

@deepthi deepthi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@deepthi deepthi merged commit 4410733 into vitessio:master Jan 23, 2021
@deepthi deepthi deleted the rn-fix-maxvrlag branch January 23, 2021 20:01
Copy link
Contributor

@PrismaPhonic PrismaPhonic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants