Commit Graph

88 Commits

Author SHA1 Message Date
Ziyi Yan 59919f9007 test: add an integration test for duplicate keys insertion and delete-your-writes
Signed-off-by: Ziyi Yan <ziyi.yan@foxmail.com>
2021-02-11 23:05:17 +08:00
ekexium 89ac804705
Fix several bugs in pessimistic transaction (#218)
* enable pessimistic_lock req to return values

Signed-off-by: ekexium <ekexium@gmail.com>

* refactor Mutation: Lock should be able to cache values

Signed-off-by: ekexium <ekexium@gmail.com>

* fix: read and lock operations should not override each other

Signed-off-by: ekexium <ekexium@gmail.com>

* rewrite get_for_update: make semantics similar to TiDB

Signed-off-by: ekexium <ekexium@gmail.com>

* fix: correctly set for_update_ts for pessimistic rollback request

Signed-off-by: ekexium <ekexium@gmail.com>

* fix: allow update_cache to 'update' existing keys, but check the values

Signed-off-by: ekexium <ekexium@gmail.com>

* test: add test for pessimistic rollback

Signed-off-by: ekexium <ekexium@gmail.com>

* doc: add some doc for get_for_update

Signed-off-by: ekexium <ekexium@gmail.com>

* fix: make batch_for_update private

Signed-off-by: ekexium <ekexium@gmail.com>

* resolve comments

Signed-off-by: ekexium <ekexium@gmail.com>

* ci: sleep a while to wait for PD

Signed-off-by: ekexium <ekexium@gmail.com>

* feat: lock_keys is available for both optimistic and pessimistic txns

Signed-off-by: ekexium <ekexium@gmail.com>

* refactor: rename ReadLockCached to CachedAndLocked

Signed-off-by: ekexium <ekexium@gmail.com>

* revert changes to `batch_get_for_update`

Signed-off-by: ekexium <ekexium@gmail.com>

* test: ignore unstable mock-tikv test

Signed-off-by: ekexium <ekexium@gmail.com>

* refactor: rename `ReadLockCached` to `Locked`

Signed-off-by: ekexium <ekexium@gmail.com>

* test: do not use Fallible

Signed-off-by: ekexium <ekexium@gmail.com>

* doc: update readme format

Signed-off-by: ekexium <ekexium@gmail.com>

Co-authored-by: Nick Cameron <nrc@ncameron.org>
2021-01-14 16:56:28 +08:00
Nick Cameron e7d46911ef txn: implement heart beat
Signed-off-by: Nick Cameron <nrc@ncameron.org>
2021-01-13 15:02:40 +13:00
ekexium 0de0163b29 add an option to control the behavior when txns get dropped
Signed-off-by: ekexium <ekexium@gmail.com>
2021-01-11 11:59:13 +08:00
ekexium 2a709116a6 update rand to 0.8
Signed-off-by: ekexium <ekexium@gmail.com>
2021-01-06 15:53:57 +08:00
Nick Cameron 3a29cb39a4 Address reviewer comments
Signed-off-by: Nick Cameron <nrc@ncameron.org>
2021-01-06 08:55:09 +13:00
Nick Cameron b46022b7db Some renaming (and adds one method)
Signed-off-by: Nick Cameron <nrc@ncameron.org>
2021-01-05 14:48:57 +13:00
ekexium da63451caf fix integration tests
Signed-off-by: ekexium <ekexium@gmail.com>
2020-12-24 15:20:00 +08:00
Nick Cameron 9dcf298d87 Implement prewrite for async commit and 1pc
Signed-off-by: Nick Cameron <nrc@ncameron.org>
2020-12-04 21:25:04 +13:00
Andy Lok 9cb904a499 split scan() into scan() and scan_keys()
Signed-off-by: Andy Lok <andylokandy@hotmail.com>
2020-11-24 17:45:11 +08:00
ekexium 6b3996ee76 fix: snapshot don't panic on drop
Signed-off-by: ekexium <ekexium@gmail.com>
2020-11-12 14:25:56 +08:00
ekexium 9ca9aa79c6
GC: initial implementation (#182)
Signed-off-by: ekexium <ekexium@gmail.com>
2020-10-13 16:22:56 +08:00
Nick Cameron d9935c2936
Merge pull request #179 from ekexium/fix-raw-scan-limit
Fix limit problem in raw_scan and unbouned problem in batch_scan
2020-10-13 09:31:56 +13:00
ekexium 7c584fbb80
Merge branch 'master' into fix-txn-batch-scan 2020-10-12 11:55:21 +08:00
ekexium 319ec52545 fix typo
Signed-off-by: ekexium <ekexium@gmail.com>
2020-10-12 11:53:54 +08:00
ekexium 10b6f44b45 format code
Signed-off-by: ekexium <ekexium@gmail.com>
2020-09-29 18:17:49 +08:00
ekexium cd9c87e24b fix Some(empty) == unbouned problem in group_ranges_by_region
Signed-off-by: ekexium <ekexium@gmail.com>
2020-09-29 15:57:52 +08:00
ekexium bcd18b3e53 fix limit of raw_scan
Signed-off-by: ekexium <ekexium@gmail.com>
2020-09-29 15:20:42 +08:00
George Teo ad8ef075af
Add codec for encoding region for transaction client (#162)
Add codec for encoding region for transaction client. Fix some other bugs.

Signed-off-by: George Teo <george.c.teo@gmail.com>
Co-authored-by: ekexium <ekexium@gmail.com>
2020-09-29 14:05:39 +08:00
ekexium ca160b8fa8
Merge branch 'master' into fix-txn-batch-scan 2020-09-23 16:07:51 +08:00
ekexium 1c383ae2e1 fix txn.batch_get() signature; now it returns Iter<KvPair>, and skips non-existent entries
Signed-off-by: ekexium <ekexium@gmail.com>
2020-09-23 16:02:53 +08:00
ekexium e2c74dcdba fix integration tests
Signed-off-by: ekexium <ekexium@gmail.com>
2020-09-23 14:24:39 +08:00
Nick Cameron dd542e0f39
Merge branch 'master' into rename 2020-09-23 16:59:34 +12:00
ekexium fae7ac85f4 add serial txn bank transfer test
Signed-off-by: ekexium <ekexium@gmail.com>
2020-09-23 10:19:48 +08:00
ekexium 67b52a998c integration tests: add raw client test
Signed-off-by: ekexium <ekexium@gmail.com>
2020-09-22 16:15:01 +08:00
ekexium 475fe54194 rename txn.set to txn.put
Signed-off-by: ekexium <ekexium@gmail.com>
2020-09-22 10:50:17 +08:00
ekexium 93182159d9 raw bank transfer test
Signed-off-by: ekexium <ekexium@gmail.com>
2020-09-17 16:23:21 +08:00
ekexium d7bded1fbf
Extract low-level store and pd crates. (#157)
Signed-off-by: ekexium <ekexium@gmail.com>
2020-07-16 11:41:57 +08:00
Yilin Chen 91aaedff2b
update dependencies and fix ci
Signed-off-by: Yilin Chen <sticnarf@gmail.com>
2020-03-19 12:17:46 +08:00
Ana Hobden 8d2c784c88
update nightly (#124)
* update nightly

Signed-off-by: Ana Hobden <operator@hoverbear.org>

* Resolve clippy

Signed-off-by: Ana Hobden <operator@hoverbear.org>

* Fix integration tests

Signed-off-by: Ana Hobden <operator@hoverbear.org>

* Reflect comments

Signed-off-by: Ana Hobden <operator@hoverbear.org>

* fmt

Signed-off-by: Ana Hobden <operator@hoverbear.org>
2019-11-21 18:04:15 -08:00
Yilin Chen 4c6ab294ef
Update and delete in integration tests
Signed-off-by: Yilin Chen <sticnarf@gmail.com>
2019-09-25 13:02:35 +08:00
Yilin Chen 3ab4252e1d
Remove dummy_impl_has_locks macro
Signed-off-by: Yilin Chen <sticnarf@gmail.com>
2019-09-23 11:47:49 +08:00
Yilin Chen 1083aef8b4
Add integration tests
Signed-off-by: Yilin Chen <sticnarf@gmail.com>
2019-09-23 11:30:21 +08:00
Yilin Chen b15d8ab935
Fix doctests
Signed-off-by: Yilin Chen <sticnarf@gmail.com>
2019-08-30 12:35:14 +08:00
Yilin Chen f093c64f21
Upgrade toolchain and dependencies.
CI errors should be fixed and feature gates are removed.

Signed-off-by: Yilin Chen <sticnarf@gmail.com>
2019-08-26 11:45:04 +08:00
Nick Cameron 8165adf1f9 Refactor into a request-style API (#87)
* Refactor the raw API to be command-oriented

Signed-off-by: Nick Cameron <nrc@ncameron.org>

* WIP: provide mocks and use them for tests

Signed-off-by: Nick Cameron <nrc@ncameron.org>
2019-08-09 07:53:55 -07:00
Yilin Chen e652a6aeb4 Add a new TSO implementation
Signed-off-by: Yilin Chen <sticnarf@gmail.com>
2019-08-01 02:05:24 +08:00
Yilin Chen 94f080e269 Add integration tests for get TS
Signed-off-by: Yilin Chen <sticnarf@gmail.com>
2019-07-31 13:53:57 +08:00