-
-
Notifications
You must be signed in to change notification settings - Fork 93
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
How to deal with replication lag? #257
Comments
Yeah, timeouts are not a solution. With a quick look I'm wondering if #256 might potentially fix the issue without having to create a workaround. |
I checked #256 , I doubt if it helps with this situation but can give it a try. I can test and report tonight. |
Ok I tested #256 just now and it does not solve the issue I'm facing. As a temporary solution I'll just add a timeout to my fork. I'll try to find a real solution. Any suggestions? Ideas? Does anyone know any way to fetch documents from primary? |
Wouldn't this need to be solved by setting appropriate write/read concerns? Of course this comes with a performance cost... |
Yeah, that'll solve the issue. However, I'll need to define a global write concern (couldn't find a way to set write concern for insert/update in meteor). I'm fine with the performance cost, in my case faster read is more important compared to faster write. But then if one of the secondaries die the write operation returns with an error. I'm not a mongo expert, that's what I understood from mongo docs, and a few questions on stackoverflow. |
The related ticket in the meteor repository (meteor/meteor#10443) might also be worth a look. |
Suggested in meteor/meteor#10443 might solve the issue, but the entire point of having secondaries, at least in my case, is to read from secondaries. Anyways, thank you all for your suggestions, I ended up making this. Posting here for reference. |
I think I just ran into this issue too. I updated my production app's It looks like this stopped I'm seeing quite a few errors around the app because of this. Perhaps updating my hooks to get their values from One weird thing is after adding |
My
after.update
hooks return the old document because of replication lag (meteor writes the update to primary, collection hooks reads the document from secondary before it gets a chance to synchronize with primary).How to deal with this? I cannot simply add a timeout to my hooks, that won't solve the issue.
The text was updated successfully, but these errors were encountered: