Commit Graph

882 Commits

Author SHA1 Message Date
Nick Cameron ae1479a850
Merge pull request #231 from ekexium/default-pd-address-for-examples
Give examples default pd addresses
2021-01-25 09:10:09 +13:00
Stepan Henek ad1a8fdf73
fixup! Fix warnings when generating docs
Signed-off-by: Stepan Henek <stepan@henek.name>
2021-01-23 22:58:43 +01:00
ekexium c42305a045 give examples default pd addresses
Signed-off-by: ekexium <ekexium@gmail.com>
2021-01-22 17:47:56 +08:00
Stepan Henek 42ad8a5065
Fix warnings when generating docs
And use travis to check whether there are warnings in docs and treat
them as errors.

Signed-off-by: Stepan Henek <stepan@henek.name>
2021-01-20 14:39:43 +01:00
Nick Cameron a7c41819c3
Merge pull request #229 from andylokandy/exist
Add key_exists method
2021-01-19 10:23:56 +13:00
Andy Lok e165566e43 fix typo
Signed-off-by: Andy Lok <andylokandy@hotmail.com>
2021-01-18 21:31:28 +08:00
Andy Lok ef14345b2b Update README.md
Signed-off-by: Andy Lok <andylokandy@hotmail.com>
2021-01-18 18:24:05 +08:00
Andy Lok c8c7c02dcd Add example for key_exists
Signed-off-by: Andy Lok <andylokandy@hotmail.com>
2021-01-18 18:18:54 +08:00
Andy Lok 25ea196aad Add key_exists method
Signed-off-by: Andy Lok <andylokandy@hotmail.com>
2021-01-15 16:41:59 +08:00
Andy Lok e46f2b431d Distinguish not existing key and existing key with empty value in get_for_update
Signed-off-by: Andy Lok <andylokandy@hotmail.com>
2021-01-15 14:55:49 +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 61299d840a
Merge pull request #221 from nrc/cmds
Implement some missing API
2021-01-14 09:12:49 +13:00
Nick Cameron 0e7839be76
Merge branch 'master' into cmds 2021-01-13 16:07:39 +13:00
Nick Cameron d1f8a9ef9e
Merge pull request #226 from ekexium/make-checklevel-public
Make CheckLevel public
2021-01-13 16:07:27 +13:00
Nick Cameron 6296ec6587
Merge branch 'master' into make-checklevel-public 2021-01-13 16:02:11 +13:00
Nick Cameron 0c68c51d63
Merge pull request #224 from ekexium/deadlock-comment
Add some comment for deadlock #219
2021-01-13 16:01:48 +13:00
Nick Cameron 4c4cbb8c74 Implement request API for check txn status and check secondary locks
Signed-off-by: Nick Cameron <nrc@ncameron.org>
2021-01-13 15:59:40 +13:00
Nick Cameron e7d46911ef txn: implement heart beat
Signed-off-by: Nick Cameron <nrc@ncameron.org>
2021-01-13 15:02:40 +13:00
Nick Cameron 5a256f0c73 Add some missing requests to the store client
Signed-off-by: Nick Cameron <nrc@ncameron.org>
2021-01-13 15:02:40 +13:00
ekexium 32f0a0213e make CheckLevel public
Signed-off-by: ekexium <ekexium@gmail.com>
2021-01-12 18:23:30 +08:00
ekexium c1cd2acd49 add some comment for deadlock
Signed-off-by: ekexium <ekexium@gmail.com>
2021-01-12 17:44:29 +08:00
ekexium f2dfb8ab3c
Fix deadlock in pd cluster (#219)
Signed-off-by: ekexium <ekexium@gmail.com>
Signed-off-by: Andy Lok <andylokandy@hotmail.com>
Signed-off-by: longfangsong <longfangsong@icloud.com>
2021-01-12 17:16:58 +08:00
Nick Cameron 75fa6aec11
Merge pull request #222 from ekexium/fix-txn-bank-transfer
Add an option to control the behavior when txns get dropped
2021-01-12 17:00:24 +13:00
ekexium 121352e173 Merge branch 'fix-txn-bank-transfer' of github.com:ekexium/client-rust into fix-txn-bank-transfer 2021-01-12 10:14:06 +08:00
ekexium 4a9a023561 update comment
Signed-off-by: ekexium <ekexium@gmail.com>
2021-01-12 10:13:35 +08:00
Nick Cameron b83a4bcd98
Merge branch 'master' into fix-txn-bank-transfer 2021-01-12 10:07:52 +13:00
Nick Cameron 1ea0550902
Merge pull request #223 from ekexium/fix-nightly-clippy
Refactor: fix nightly cargo clippy
2021-01-12 09:59:55 +13:00
Nick Cameron 70c63a67ee
Merge branch 'master' into fix-nightly-clippy 2021-01-12 09:58:53 +13:00
Nick Cameron 33c6d276d8
Merge pull request #210 from longfangsong/master
fix using wrong primary key
2021-01-12 09:48:49 +13:00
ekexium 578be6cff2 refactor: fix nightly cargo clippy
Signed-off-by: ekexium <ekexium@gmail.com>
2021-01-11 16:40:38 +08:00
ekexium 0857bf25bd add a None level
Signed-off-by: ekexium <ekexium@gmail.com>
2021-01-11 13:30:28 +08:00
longfangsong 5ab439f75f update comments
Signed-off-by: longfangsong <longfangsong@icloud.com>
2021-01-11 13:02:54 +08: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
longfangsong 4d33d88e5f apply suggestions from reviewing
Signed-off-by: longfangsong <longfangsong@icloud.com>
2021-01-08 13:54:49 +08:00
longfangsong d2f3005e5a fix not filtering out the primary key when collecting secondary keys
Signed-off-by: longfangsong <longfangsong@icloud.com>
2021-01-08 13:49:22 +08:00
longfangsong c556293cad fix not filtering out the primary key when collecting secondary keys
Signed-off-by: longfangsong <longfangsong@icloud.com>
2021-01-08 13:45:45 +08:00
longfangsong 161433f7aa add primary_key field to TwoPhaseCommitter
Signed-off-by: longfangsong <longfangsong@icloud.com>
2021-01-08 13:44:48 +08:00
longfangsong d78d105807 move primary to buffer
Signed-off-by: longfangsong <longfangsong@icloud.com>
2021-01-08 13:43:16 +08:00
Nick Cameron 3392e6341b
Merge pull request #215 from ekexium/ignore-cargo-lock
Update dependency
2021-01-07 09:03:33 +13:00
ekexium 2a709116a6 update rand to 0.8
Signed-off-by: ekexium <ekexium@gmail.com>
2021-01-06 15:53:57 +08:00
ekexium c71ac8740c update fail, promethues, proptest
Signed-off-by: ekexium <ekexium@gmail.com>
2021-01-06 15:50:39 +08:00
ekexium c1bb955832 use tempfile to replace tempdir
Signed-off-by: ekexium <ekexium@gmail.com>
2021-01-06 15:46:23 +08:00
ekexium 684059a341 update grpcio to 0.7
Signed-off-by: ekexium <ekexium@gmail.com>
2021-01-06 15:32:28 +08:00
ekexium a8f52b9ba8 update tokio to 1.0
Signed-off-by: ekexium <ekexium@gmail.com>
2021-01-06 15:21:55 +08:00
ekexium 6b8b61fc79 ignore Cargo.lock
Signed-off-by: ekexium <ekexium@gmail.com>
2021-01-06 14:05:34 +08:00
Nick Cameron 2d657d74be
Merge pull request #213 from nrc/options
Refactor the transaction API re how we set options, and add some options to skip resolve and retry
2021-01-06 10:22:50 +13: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 f90a82fe35 Add some docs and move try_one_pc out of options ctor
Signed-off-by: Nick Cameron <nrc@ncameron.org>
2021-01-05 14:48:57 +13:00
Nick Cameron 1c7e843b54 Refactor the retry options
Signed-off-by: Nick Cameron <nrc@ncameron.org>
2021-01-05 14:48:57 +13:00
Nick Cameron 5d584d93b3 Add option to not automatically resolve regions
Signed-off-by: Nick Cameron <nrc@ncameron.org>
2021-01-05 14:48:57 +13:00