|
| 1 | +# ------------------------------------------------------------- |
| 2 | +# This test is a regression test for an issue in which a |
| 3 | +# series of acquires resulted in the lock table holding an unreplicated |
| 4 | +# lock belonging to an older epoch. |
| 5 | +# |
| 6 | +# The actual test failure involved a longer and more complicated |
| 7 | +# sequence of acquisition, here we've reduce it the following |
| 8 | +# operations on a single key: |
| 9 | +# |
| 10 | +# Req0: Put@epo=0 (not included below since it has no lock table side effects) |
| 11 | +# Req1: Get(Exclusive, Unreplicated)@epo=0 |
| 12 | +# Req2: Get(Shared, Replicated)@epo=0 |
| 13 | +# Req3: Put@epo=0 |
| 14 | +# |
| 15 | +# Then we bump the transaction Epoch to 1 but leave the WriteTimestamp |
| 16 | +# the same -- simulating an IntentMissingError on some unrelated |
| 17 | +# key. |
| 18 | +# |
| 19 | +# Finally, we send what would be the first request in the retrying |
| 20 | +# transaction: |
| 21 | +# |
| 22 | +# Req4: Put@epo=1 |
| 23 | +# |
| 24 | +# Previously, this sequence would leave the unreplicated lock from |
| 25 | +# epoch=0 in our lock table. In most cases this does not cause |
| 26 | +# problems, but if we want to flush the lock table to disk, we would |
| 27 | +# fail with an error. |
| 28 | +# ------------------------------------------------------------- |
| 29 | + |
| 30 | +new-lock-table maxlocks=10000 |
| 31 | +---- |
| 32 | + |
| 33 | +new-txn txn=txn1 ts=10,1 epoch=0 seq=1 |
| 34 | +---- |
| 35 | + |
| 36 | +new-request r=req1 txn=txn1 ts=10,1 spans=intent@a |
| 37 | +---- |
| 38 | + |
| 39 | +scan r=req1 |
| 40 | +---- |
| 41 | +start-waiting: false |
| 42 | + |
| 43 | +acquire r=req1 k=a durability=u strength=exclusive |
| 44 | +---- |
| 45 | +num=1 |
| 46 | + lock: "a" |
| 47 | + holder: txn: 00000000-0000-0000-0000-000000000001 epoch: 0, iso: Serializable, ts: 10.000000000,1, info: unrepl [(str: Exclusive seq: 1)] |
| 48 | + |
| 49 | +dequeue r=req1 |
| 50 | +---- |
| 51 | +num=1 |
| 52 | + lock: "a" |
| 53 | + holder: txn: 00000000-0000-0000-0000-000000000001 epoch: 0, iso: Serializable, ts: 10.000000000,1, info: unrepl [(str: Exclusive seq: 1)] |
| 54 | + |
| 55 | + |
| 56 | +new-request r=req2 txn=txn1 ts=10,1 spans=shared@a |
| 57 | +---- |
| 58 | + |
| 59 | +scan r=req2 |
| 60 | +---- |
| 61 | +start-waiting: false |
| 62 | + |
| 63 | +acquire r=req2 k=a durability=r strength=shared |
| 64 | +---- |
| 65 | +num=1 |
| 66 | + lock: "a" |
| 67 | + holder: txn: 00000000-0000-0000-0000-000000000001 epoch: 0, iso: Serializable, ts: 10.000000000,1, info: repl [Shared], unrepl [(str: Exclusive seq: 1)] |
| 68 | + |
| 69 | +dequeue r=req2 |
| 70 | +---- |
| 71 | +num=1 |
| 72 | + lock: "a" |
| 73 | + holder: txn: 00000000-0000-0000-0000-000000000001 epoch: 0, iso: Serializable, ts: 10.000000000,1, info: repl [Shared], unrepl [(str: Exclusive seq: 1)] |
| 74 | + |
| 75 | + |
| 76 | +new-request r=req3 txn=txn1 ts=10,1 spans=intent@a |
| 77 | +---- |
| 78 | + |
| 79 | +scan r=req3 |
| 80 | +---- |
| 81 | +start-waiting: false |
| 82 | + |
| 83 | +acquire r=req3 k=a durability=r strength=intent |
| 84 | +---- |
| 85 | +num=1 |
| 86 | + lock: "a" |
| 87 | + holder: txn: 00000000-0000-0000-0000-000000000001 epoch: 0, iso: Serializable, ts: 10.000000000,1, info: repl [Intent, Shared], unrepl [(str: Exclusive seq: 1)] |
| 88 | + queued locking requests: |
| 89 | + active: false req: 3 promoting: true, strength: Intent, txn: 00000000-0000-0000-0000-000000000001 |
| 90 | + |
| 91 | +dequeue r=req3 |
| 92 | +---- |
| 93 | +num=1 |
| 94 | + lock: "a" |
| 95 | + holder: txn: 00000000-0000-0000-0000-000000000001 epoch: 0, iso: Serializable, ts: 10.000000000,1, info: repl [Intent, Shared], unrepl [(str: Exclusive seq: 1)] |
| 96 | + |
| 97 | +# Update Epoch but not the WriteTimestamp like an IntentMissingError. |
| 98 | +update-txn-not-observed txn=txn1 ts=10,1 epoch=1 seq=1 |
| 99 | +---- |
| 100 | + |
| 101 | +new-request r=req4 txn=txn1 ts=10,1 spans=intent@a |
| 102 | +---- |
| 103 | + |
| 104 | +scan r=req4 |
| 105 | +---- |
| 106 | +start-waiting: false |
| 107 | + |
| 108 | +acquire r=req4 k=a durability=r strength=intent |
| 109 | +---- |
| 110 | +num=1 |
| 111 | + lock: "a" |
| 112 | + holder: txn: 00000000-0000-0000-0000-000000000001 epoch: 1, iso: Serializable, ts: 10.000000000,1, info: repl [Intent, Shared] |
| 113 | + |
| 114 | +dequeue r=req4 |
| 115 | +---- |
| 116 | +num=1 |
| 117 | + lock: "a" |
| 118 | + holder: txn: 00000000-0000-0000-0000-000000000001 epoch: 1, iso: Serializable, ts: 10.000000000,1, info: repl [Intent, Shared] |
0 commit comments