[SERVER-34308] Transactions on secondaries should take IS locks instead of IX Created: 04/Apr/18 Updated: 06/Dec/22 Resolved: 20/Sep/19 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Replication |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Task | Priority: | Major - P3 |
| Reporter: | Tess Avitabile (Inactive) | Assignee: | Backlog - Replication Team |
| Resolution: | Won't Fix | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Assigned Teams: |
Replication
|
| Participants: |
| Description |
|
Operations in multi-statement transactions take IX locks. This is because if a transaction starts with a read, and we later perform a write, there is no way to upgrade the lock mode. Transactions on secondaries should never include writes (and attempting to write should implicitly abort the transaction), so there is no reason to take IX locks. Moreover, a stashed transaction holding IX locks can block an operation that needs an S lock (such as listCollections), which can block oplog application. Thus it is important that transactions on secondaries do not take IX locks like they do on primaries. This work requires that we use two-phase locking for shared locks in read-only transactions on secondaries. |
| Comments |
| Comment by Ratika Gandhi [ 20/Sep/19 ] |
|
Deferred to when we design the epic. |