Skip to content

Conversation

edaniels
Copy link
Contributor

@edaniels edaniels commented Nov 2, 2018

General algorithm and implementation status:
For each operation
1. Take out a collection level (NS) lock (done)
2. For reads
2a. do a normal read and release the lock (done)
3. For writes
3a. find documents to be affected (done)
3b. Write the documents to an undo collection (done)
3c. do the write to the local collection (done)
3d. mark the document config as having an uncommitted write (done)
3e. remove the undo document (done)
4. Unlock the collection level lock (done)

For sync
1. For each namespace to synchronize, take out a lock when wanting to making read/writes on doc configs/local collection (done)

On DataSynchronizer startup
1. Lock the NS and dispatch a request to do the below (done)
2. Search for any undo documents (done)
3. Replace the local database version of the document with the undo document (done)
4. Set difference of local docs and configs. Remove difference from local docs (done)
5. Unlock the NS (done)

Drive-bys:

  • insertOneAndSync -> insertOne
  • insertManyAndSync -> insertMany
  • Remove Server version of Sync
  • Stop publishing Server version local MongoDB service

@edaniels edaniels requested review from adamchel, jsflax and dkaminsky and removed request for adamchel November 2, 2018 00:14
@coveralls
Copy link

Coverage Status

Coverage decreased (-43.3%) to 27.5% when pulling 82e40da on edaniels:STITCH-1958 into ee20789 on mongodb:master.

@coveralls
Copy link

coveralls commented Nov 2, 2018

Coverage Status

Coverage decreased (-5.08%) to 66.833% when pulling 48460af on edaniels:STITCH-1958 into 7c836d0 on mongodb:master.

@edaniels edaniels force-pushed the STITCH-1958 branch 2 times, most recently from da859df to 187f94f Compare November 2, 2018 01:55
Copy link
Contributor

@jsflax jsflax left a comment

Choose a reason for hiding this comment

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

This LGTM! Great job. I imagine it might be tough to write an integration test for this, but it would be nice to see a unit test or two to test the recovery functionality.

Copy link
Contributor

@adamchel adamchel left a comment

Choose a reason for hiding this comment

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

This looks great! Couple nits and q's, and I agree with Jason that a test would be nice.

Copy link
Contributor

@dkaminsky dkaminsky left a comment

Choose a reason for hiding this comment

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

lgtm

@edaniels edaniels merged commit 316898d into mongodb:master Nov 2, 2018
@edaniels edaniels deleted the STITCH-1958 branch November 2, 2018 20:05
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.

5 participants