forked from cockroachdb/cockroach
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
102260: kv: teach kvnemesis about isolation levels and snapshot isolation r=arulajmani a=nvanbenschoten Informs cockroachdb#100169. This commit teaches kvnemesis about transaction isolation levels, and specifically to generate snapshot isolation transaction closures. The commit is strictly plumbing because isolation level is currently a no-op. Once snapshot isolation is implemented, the validator logic in kvnemesis will need to change. Release note: None Co-authored-by: Nathan VanBenschoten <[email protected]>
- Loading branch information
Showing
111 changed files
with
336 additions
and
125 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
echo | ||
---- | ||
db0.Del(ctx, tk(2) /* @s1 */) // context canceled | ||
db1.Del(ctx, tk(2) /* @s1 */) // context canceled |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
echo | ||
---- | ||
db1.DelRange(ctx, tk(2), tk(3), true /* @s12 */) // context canceled | ||
db0.DelRange(ctx, tk(2), tk(3), true /* @s12 */) // context canceled |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
echo | ||
---- | ||
db1.Get(ctx, tk(1)) // context canceled | ||
db0.Get(ctx, tk(1)) // context canceled |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
echo | ||
---- | ||
db0.Put(ctx, tk(1), sv(1)) // context canceled | ||
db1.Put(ctx, tk(1), sv(1)) // context canceled |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
echo | ||
---- | ||
db0.ReverseScan(ctx, tk(1), tk(3), 0) // context canceled | ||
db1.ReverseScan(ctx, tk(1), tk(3), 0) // context canceled |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
echo | ||
---- | ||
db1.ReverseScanForUpdate(ctx, tk(1), tk(3), 0) // context canceled | ||
db0.ReverseScanForUpdate(ctx, tk(1), tk(3), 0) // context canceled |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
echo | ||
---- | ||
db1.ScanForUpdate(ctx, tk(1), tk(3), 0) // context canceled | ||
db0.ScanForUpdate(ctx, tk(1), tk(3), 0) // context canceled |
1 change: 1 addition & 0 deletions
1
...sis/testdata/TestApplier/txn-commit-batch → .../testdata/TestApplier/txn-si-commit-batch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
echo | ||
---- | ||
db0.Txn(ctx, func(ctx context.Context, txn *kv.Txn) error { | ||
txn.SetIsoLevel(isolation.Snapshot) | ||
txn.Put(ctx, tk(5), sv(5)) // @<ts> <nil> | ||
{ | ||
b := &kv.Batch{} | ||
b.Put(tk(6), sv(6)) // <nil> | ||
b.DelRange(tk(3), tk(5), true /* @s1 */) // <nil> | ||
txn.Run(ctx, b) // @<ts> <nil> | ||
} | ||
return nil | ||
}) // @<ts> <nil> | ||
// ^-- txnpb:<txn> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
echo | ||
---- | ||
db1.Txn(ctx, func(ctx context.Context, txn *kv.Txn) error { | ||
txn.SetIsoLevel(isolation.Snapshot) | ||
txn.DelRange(ctx, tk(2), tk(4), true /* @s1 */) // @<ts> <nil> | ||
return nil | ||
}) // @<ts> <nil> | ||
// ^-- txnpb:<txn> |
1 change: 1 addition & 0 deletions
1
...kv/kvnemesis/testdata/TestApplier/txn-err → ...kvnemesis/testdata/TestApplier/txn-si-err
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
echo | ||
---- | ||
db0.Txn(ctx, func(ctx context.Context, txn *kv.Txn) error { | ||
txn.SetIsoLevel(isolation.Snapshot) | ||
txn.DelRange(ctx, tk(2), tk(4), true /* @s1 */) | ||
return nil | ||
}) // context canceled |
1 change: 1 addition & 0 deletions
1
.../kvnemesis/testdata/TestApplier/txn-error → ...esis/testdata/TestApplier/txn-si-rollback
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
echo | ||
---- | ||
db0.Txn(ctx, func(ctx context.Context, txn *kv.Txn) error { | ||
txn.SetIsoLevel(isolation.Snapshot) | ||
txn.Put(ctx, tk(5), sv(5)) // @<ts> <nil> | ||
return errors.New("rollback") | ||
}) // rollback |
Oops, something went wrong.