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 Log Replication Deletions #7234

Merged

Conversation

tangledbytes
Copy link
Member

Explain the changes

This PR ensures that even if multiple actions are performed on an object, we process all of the actions instead of processing only the last one. Processing only the last action causes issues in the scenario when the logs are not chronologically ordered, for example: DELETE /cat.jpeg then PUT /cat.jpeg, when these 2 entries are part of the same candidate batch, NooBaa would just process the last PUT which means that the DELETE will never be processed.

PS: Added JS Docs to have the static analysis "safety net".

Issues: Fixed #xxx / Gap #xxx

This issue was discovered by Sagi (QE) during happy path testing.

  • Doc added/updated
  • Tests added

@romayalon
Copy link
Contributor

romayalon commented Mar 20, 2023

@Utkarsh-pro #7235 will this PR verify these changes?

// if there is already a candidate for the same key, then we have a conflict
if (time_map[key]) {
const conflict_candidate = time_map[key];
conflict_candidate.action = 'conflict';
Copy link
Contributor

Choose a reason for hiding this comment

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

should we avoid here versioning enabled buckets? this "squash" will not create the same versions as we have in the source bucket

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, I had questions about versioned objects when I picked up the task. Unfortunately, we don't yet have a "doc" yet (not that I know of) which clarifies how we deal with the cases like:

  • Source has versioning destination doesn't.
  • Destination has versioning source doesn't.
  • Both have versioning.

eg. What to do with delete markers when destination doesn't have versioning? Not that it can't be done, just that we don't have it documented yet.

This might be a broader discussion I think, that's why the implementation currently does not do anything special when it comes to versioned objects.

Copy link
Contributor

Choose a reason for hiding this comment

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

Alright, for creating a better user experience I think that we should document it

src/server/bg_services/replication_log_parser.js Outdated Show resolved Hide resolved
@tangledbytes tangledbytes force-pushed the utkarsh-pro/fix/log-replication branch from 30f4c19 to 3d8652c Compare March 22, 2023 12:57
Neon-White added a commit to Neon-White/noobaa-core that referenced this pull request Mar 28, 2023
Signed-off-by: Ben <belimele@redhat.com>

// if there is already a candidate for the same key, then we have a conflict
if (logs_for_key_time_map.has(log.time)) {
// TODO: Object versioning will raise false alarms here
Copy link
Contributor

Choose a reason for hiding this comment

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

please open a github issue for that, it's a real gap the we should address

Copy link
Member Author

Choose a reason for hiding this comment

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

@romayalon, opened an issue here: #7252

Copy link
Contributor

Choose a reason for hiding this comment

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

perfect, thanks!

Signed-off-by: Utkarsh Srivastava <srivastavautkarsh8097@gmail.com>
@tangledbytes tangledbytes force-pushed the utkarsh-pro/fix/log-replication branch from 3d8652c to e822e4c Compare March 30, 2023 08:10
@tangledbytes tangledbytes merged commit aeb5e82 into noobaa:master Mar 30, 2023
Neon-White added a commit to Neon-White/noobaa-core that referenced this pull request Apr 17, 2023
Signed-off-by: Ben <belimele@redhat.com>
baum pushed a commit to Neon-White/noobaa-core that referenced this pull request Apr 19, 2023
Neon-White added a commit to Neon-White/noobaa-core that referenced this pull request Apr 24, 2023
Signed-off-by: Ben <belimele@redhat.com>
Neon-White added a commit to Neon-White/noobaa-core that referenced this pull request Apr 27, 2023
Signed-off-by: Ben <belimele@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants