[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:
Backports
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:

  1. A transaction writes to a collection C that doesn't exist. In a different session, collection C is then created. Verify that the transaction can then write to collection C and commit.
  2. A transactions writes to a collection C that exists. A client in a different session that tries to create C should fail.

*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: SERVER-34652 SERVER-34654 SERVER-34703 SERVER-34704 Test transactions with concurrent DDL operations

(cherry picked from commit 14ffe1360e095d98da824bb63417672f3b171270)
Branch: v4.0
https://github.com/mongodb/mongo/commit/00c01f088742a70bd93843d0dac5900c64e97b98

Comment by Githook User [ 05/Jun/18 ]

Author:

{'username': 'tessavitabile', 'name': 'Tess Avitabile', 'email': 'tess.avitabile@mongodb.com'}

Message: SERVER-34652 SERVER-34654 SERVER-34703 SERVER-34704 Test transactions with concurrent DDL operations
Branch: master
https://github.com/mongodb/mongo/commit/14ffe1360e095d98da824bb63417672f3b171270

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.

Generated at Thu Feb 08 04:37:24 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.