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

Include collection name in oplog query #78

Merged
merged 5 commits into from
Apr 15, 2022

Conversation

zachharris1
Copy link
Contributor

@zachharris1 zachharris1 commented Apr 13, 2022

Description of change

Currently we traverse all new oplog changes for each collection, once per collection. This change makes it so we only traverse entries for the current collection.

WIP: this breaks bookmark logic.

QA steps

  • automated tests passing
  • manual qa steps passing (list below)

Risks

Rollback steps

  • revert this branch

zachharris1 and others added 3 commits April 13, 2022 20:09
* Move `get_latest_ts` call higher

* Write state if we didn't sync anything for a stream

* Add test

* Don't do a deepcopy on state

* Remove unused import
Copy link
Contributor

@kspeer825 kspeer825 left a comment

Choose a reason for hiding this comment

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

Some comment cleanup, and left one suggestion to adjust the scenario.

# -----------------------------------
# ----------- Initial Full Table ---------
# -----------------------------------
# Select simple_coll_1 and simple_coll_2 streams and add replication method metadata
Copy link
Contributor

Choose a reason for hiding this comment

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

Looks like only collection 1 is selected. Can you update this comment.

Copy link
Contributor

Choose a reason for hiding this comment

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

Done

self.expected_sync_streams(),
self.expected_pks())

# Verify that we got at least 6 records due to changes
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you fix this comment

Copy link
Contributor

Choose a reason for hiding this comment

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

Done


client["simple_db"]["simple_coll_2"].insert_one({"int_field": 101, "string_field": random_string_generator()})
changed_ids.add(client['simple_db']['simple_coll_2'].find({'int_field': 101})[0]['_id'])

Copy link
Contributor

Choose a reason for hiding this comment

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

This scenario is good. I think it would be good to also update smilple_coll_1 and verify that a record comes through rather than no records.

Copy link
Contributor

Choose a reason for hiding this comment

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

This can be ignored. I misunderstood the change that was being covered here.

@cosimon cosimon merged commit 16b73b6 into master Apr 15, 2022
@cosimon cosimon deleted the optimize-oplog-only-current-ns branch April 15, 2022 15:04
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.

None yet

4 participants