-
Notifications
You must be signed in to change notification settings - Fork 138
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
Sync Gateway bucket shadowing crashes with error 'panic: parent id "xxx-xxxx" is missing' #959
Comments
Thanks for the detailed report @joshblour - we'll look into this. |
Here's the code where that panic is coming from:
|
Possible related issue: #807 |
@joshblour how long did you need to run it before reproducing the error? |
@joshblour nevermind, from the logs I can see that you had it running for about 5 mins. Thanks for the posting the logs! |
I was able to reproduce with the following changes:
|
After initially reproducing it, now it's crashing on Sync Gateway startup: |
With additional logging:
|
Here is the raw document in couchbase server. |
Here is another crash log with more debugging added. Details to follow. |
Since the Shadower runs asynchronously with the rest of the mutations, the following can happen:
|
High level description of the problem: Bucket shadowing needs the rev history to be maintained until pending revisions come over the tap feed. If you set it the rev pruning value too low, and the revision update frequency is this too high, the bucket shadower will look for revisions in the history that have already been pruned away, and the logic will fall apart at that point. There is no easy fix for this -- it would take some design discussions to figure out the best path forward. @joshblour I would suggest that you try to estimate your max doc update frequency, and assume that things can take up to 10 seconds for docs to show up to the bucket shadower, and calculate your rev tree size based on that. (and give it some slack) So if you are updating a doc once per second, set your max rev tree size to 20, which should be enough to avoid this case. If not, try setting it higher until you are unable to reproduce. |
@zgramana -- let's review this in the next sprint planning. |
@tleyden will do. Thank you for looking into this. |
I'm having this issue too, is any temporary solution for start the sync again? |
@vfernandezg , in order to start the sync again, I had to flush the sync_gateway database from the couchbase server admin portal |
We now have the repro code on issue #994. |
Action item:
|
Action item:
|
I am working on the config parameters section now. Is this too much to add? Suggestions? Thanks. Note:If you are using bucket shadowing, setting revsLimit to a value that is too small relative to the frequency of document revisions can have negative consequences. Bucket shadowing needs the revision history to be maintained until pending revisions are reconciled. We recommend that you estimate the maximum update frequency in documents per second (for example, one per second), assume that 10 seconds are needed for documents to be available to the bucket shadower, and then add some slack (for example, set the revsLimit to 20. |
@JeffThomasWriter this part is good:
but I think this part will be very confusing to users:
Not sure the best approach here... |
@JeffThomasWriter - any update on this? Did these docs get committed anywhere? |
Documented with this note for revsLimit: Note: If you use bucket shadowing, setting revsLimit to a value that is too small relative to the frequency of document revisions can have negative consequences. Bucket shadowing needs the revision history to be maintained until pending revisions are reconciled. |
I have 40 revisions as a limit and I'm still having this issue. Is there another way to prevent this error? |
Sync Gateway crashes with error 'panic: parent id "xxx-xxxx" is missing'
To trigger this error I have the revs_limit set to 3 and I'm updating a document once a second.
Full crash log here: https://gist.github.com/joshblour/59058ac4e8f9a5dd900d
You can reproduce it with my modified version of helloCBL here: https://github.com/joshblour/couchbase-lite-tutorial-ios/tree/sync_rapid_updates
I've added continuous push & pull replications and a timer to update the document once a second.
I'm running sync_gateway version 1.1.0-26 on my local machine with the following config:
The text was updated successfully, but these errors were encountered: