[SERVER-3329] Add more response fields for getLastError with w/wtimeout Created: 24/Jun/11 Updated: 20/Feb/15 Resolved: 20/Feb/15 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Replication |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Scott Hernandez (Inactive) | Assignee: | Eliot Horowitz (Inactive) |
| Resolution: | Duplicate | Votes: | 3 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||
| Participants: | |||||||||
| Description |
|
We should return the follow: "majority" : true/false //if the write was applied to a majority – no rollback will happen We talked and these should work with the new tag'n system as well. |
| Comments |
| Comment by Eric Milkie [ 20/Feb/15 ] |
|
see |
| Comment by Brian Stolz [ 30/Jul/12 ] |
|
This is a major issue for us currently. We have 3 nodes (primary and 2 secondaries). We want to be able to write to the primary, ensure that ONE Of the secondaries gets the write (ensures our data is safe and secure) and then immediately be able to read it. Often the 2nd secondary will end up with replication lag, because we are doing backups off of it .. or some other process which is bogging it down a little. That replication lag may be upwards of 5 minutes at times. Which isn't really an issue, this is why we have 2 secondaries. However, when we go to do a read from the secondaries, it has a 50% chance to pick the one which has massive lag. Which of course the document we just wrote, won't exist. So having the driver know what nodes it wrote to, would allow us to ensure we did the read from that node, and all would be fine. |
| Comment by Dattas Moonchaser [ 21/Sep/11 ] |
|
It would also be nice to be able to get the server names that the write has propagated to so that there could be a function to read from those servers, this would allow writing to replication sets and being able to read that write reliably soon after it is written. |
| Comment by Balkrishna Sharma [ 07/Jul/11 ] |
|
Even weffected could change after wtimeout, right ? |
| Comment by Scott Hernandez (Inactive) [ 24/Jun/11 ] |
|
Balkrishna, this dosen't make a lot of sense to me since by the time you get the response the write could be on all the replicas. It isn't like replication stops when the wtimeout occurs. Any writes need to go through the primary so I'm not sure how this would be accomplished using individual nodes. |
| Comment by Balkrishna Sharma [ 24/Jun/11 ] |
|
Along with the above, it will be great to return: "weffected_name" : the name of the nodes where the write was applied This will be very handy for applications that wish to create a pseudo-transaction like operation, where they wish to rollback (or flag accordingly) operations that failed because they did not make to w nodes within the specified timeout. |