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

Fix: Import data not considering the initiated cutover during resumption #2369

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

priyanshi-yb
Copy link
Contributor

@priyanshi-yb priyanshi-yb commented Mar 3, 2025

Describe the changes in this pull request

Fix - During the resumption of import data, check if the cutover is initiated before continuing the streaming. If cutover is initiated, but all the events are not processed by importer yet, on resumption, need to check if cutover event is processed by importer or not (reading the last processed queue segment by that importer and checking the last Event in that segment)

Describe if there are any user-facing changes

In resumption case of import data, it will only continue in the case there are some events left to ingest and cutover is not initiated.

How was this pull request tested?

Manually tested all the three importers (to target, to source, and to source-replica)

Does your PR have changes that can cause upgrade issues?

Component Breaking changes?
MetaDB No
Name registry json No
Data File Descriptor Json No
Export Snapshot Status Json No
Import Data State No
Export Status Json No
Data .sql files of tables No
Export and import data queue No
Schema Dump No
AssessmentDB No
Sizing DB No
Migration Assessment Report Json No
Callhome Json No
YugabyteD Tables No
TargetDB Metadata Tables No

@priyanshi-yb priyanshi-yb changed the title Fixed Import data not considering the initiated cutover during resumption Fix: Import data not considering the initiated cutover during resumption Mar 3, 2025
@priyanshi-yb priyanshi-yb marked this pull request as ready for review March 4, 2025 05:44
Copy link
Collaborator

@makalaaneesh makalaaneesh left a comment

Choose a reason for hiding this comment

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

LGTM! @sanyamsinghal can you also pls take a look. Since this is a critical part, want two sets of eyes on this!

Copy link
Collaborator

@sanyamsinghal sanyamsinghal left a comment

Choose a reason for hiding this comment

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

LGTM.
Assuming we have verified the fix - resumability for all three cases(normal, FF, FB)

CutoverToSourceProcessedBySourceImporter bool `json:"CutoverToSourceProcessedBySourceImporter"`

//All the cutover detectedc flags by importer when they processed the cutover event
Copy link
Collaborator

Choose a reason for hiding this comment

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

what does detected mean here? does it mean that cutover is complete?
I think that is not the case. processed flags are those.

Copy link
Collaborator

Choose a reason for hiding this comment

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

please make the comments a bit more descriptive in that case.

Minor nit: order of variables here

  1. Requested
  2. Detected
  3. Processed

Copy link
Contributor Author

Choose a reason for hiding this comment

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

what does detected mean here? does it mean that cutover is complete?

It means that the cutover is detected by the importer command by receiving the cutover event in the queue.

return err
}
if ok {
return nil
Copy link
Collaborator

Choose a reason for hiding this comment

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

add a log line before return

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

Successfully merging this pull request may close these issues.

3 participants