[SERVER-34654] Write test for a transaction that writes to a collection that is created concurrently Created: 24/Apr/18 Updated: 29/Oct/23 Resolved: 05/Jun/18 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Replication |
| Affects Version/s: | None |
| Fix Version/s: | 4.0.0, 4.1.1 |
| Type: | Task | Priority: | Major - P3 |
| Reporter: | William Schultz (Inactive) | Assignee: | Tess Avitabile (Inactive) |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||
| Backwards Compatibility: | Fully Compatible | ||||
| Backport Requested: |
v4.0
|
||||
| Sprint: | Repl 2018-05-21, Repl 2018-06-04, Repl 2018-06-18 | ||||
| Participants: | |||||
| Story Points: | 3 | ||||
| Description |
|
We want to verify that transactions interact with collection creation operations correctly. To verify this, we should test the following case:
*Note: when writing these test cases, we should verify any behavior that differs from what is described above and make sure it matches the desired/expected behavior. |
| Comments |
| Comment by Githook User [ 05/Jun/18 ] |
|
Author: {'username': 'tessavitabile', 'name': 'Tess Avitabile', 'email': 'tess.avitabile@mongodb.com'}Message: (cherry picked from commit 14ffe1360e095d98da824bb63417672f3b171270) |
| Comment by Githook User [ 05/Jun/18 ] |
|
Author: {'username': 'tessavitabile', 'name': 'Tess Avitabile', 'email': 'tess.avitabile@mongodb.com'}Message: |
| Comment by Tess Avitabile (Inactive) [ 23/May/18 ] |
|
I disagree with the behavior described in the first test. If a transaction attempts to write to a collection that does not exist, the write will fail and abort the transaction. Also, if a collection is created while a transaction is in progress, then if the transaction attempts to write to the collection, it will fail with SnapshotUnavailable. I would change this test to the following: "Start a transaction. In a different session, create a collection C. Verify that attempting to write to C in the transaction fails with SnapshotUnavailable." I may also omit the second test case, since it is already the case that you cannot create a collection that already exists. |