Skip to content
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

concurrency: extend testing for waitQueueMaxLengthExceeded #104147

Merged
merged 1 commit into from
Jun 1, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -177,3 +177,76 @@ num=1
active: true req: 2, txn: 00000000-0000-0000-0000-000000000002
active: true req: 3, txn: 00000000-0000-0000-0000-000000000003
distinguished req: 2

# ------------------------------------------------------------------------------
# Write requests that are already waiting in a lock's wait queue should not
# throw an error when they rescan if adding one more request to the lock's wait
# queue puts them above the max-lock-wait-queue threshold. This is because
# the request has already been accounted for when it's performing a re-scan.
# ------------------------------------------------------------------------------

new-txn txn=txn6 ts=10 epoch=0
----

new-request r=req9 txn=txn6 ts=10 spans=intent@b
----

scan r=req9
----
start-waiting: false

acquire r=req9 k=b durability=u
----
num=2
lock: "a"
holder: txn: 00000000-0000-0000-0000-000000000001, ts: 10.000000000,0, info: unrepl epoch: 0, seqs: [0]
queued writers:
active: true req: 2, txn: 00000000-0000-0000-0000-000000000002
active: true req: 3, txn: 00000000-0000-0000-0000-000000000003
distinguished req: 2
lock: "b"
holder: txn: 00000000-0000-0000-0000-000000000006, ts: 10.000000000,0, info: unrepl epoch: 0, seqs: [0]

new-txn txn=txn7 ts=10 epoch=0
----

new-request r=req10 txn=txn7 ts=10 spans=intent@b max-lock-wait-queue-length=1
----

scan r=req10
----
start-waiting: true

guard-state r=req10
----
new: state=waitForDistinguished txn=txn6 key="b" held=true guard-strength=Intent

print
----
num=2
lock: "a"
holder: txn: 00000000-0000-0000-0000-000000000001, ts: 10.000000000,0, info: unrepl epoch: 0, seqs: [0]
queued writers:
active: true req: 2, txn: 00000000-0000-0000-0000-000000000002
active: true req: 3, txn: 00000000-0000-0000-0000-000000000003
distinguished req: 2
lock: "b"
holder: txn: 00000000-0000-0000-0000-000000000006, ts: 10.000000000,0, info: unrepl epoch: 0, seqs: [0]
queued writers:
active: true req: 10, txn: 00000000-0000-0000-0000-000000000007
distinguished req: 10

# Re-scan.
scan r=req10
----
start-waiting: true

# Note that the state here changed from waitForDistinguished to waitFor. This
# is because we're cheating slightly in this test by calling scan on a request
# that's already actively waiting at a lock, which is something that cannot
# happen outside of unit tests. tryActiveWait doesn't expect this, and doesn't
# handle this state transition -- we could teach it, but it would be just for
# this contrived test scenario.
guard-state r=req10
----
new: state=waitFor txn=txn6 key="b" held=true guard-strength=Intent