Commit Graph

659 Commits

Author SHA1 Message Date
Nick Cameron 6000f66847
Merge pull request #247 from nrc/cargo
Upgrade a bunch of deps
2021-03-08 16:21:29 +13:00
Nick Cameron a602688b66 Upgrade a bunch of deps
Signed-off-by: Nick Cameron <nrc@ncameron.org>
2021-03-08 09:21:50 +13:00
Nick Cameron 47478cb59f
Merge pull request #245 from ekexium/fix-result-haserror
Fix HasError and HasLocks
2021-03-05 13:49:11 +13:00
ekexium 69ae1b81ef test: add unit tests for ExtractError, HasLocks for Result
Signed-off-by: ekexium <ekexium@gmail.com>
2021-03-03 15:27:19 +08:00
ekexium e828f9135d feat: ExtractError also checks region_error
Signed-off-by: ekexium <ekexium@gmail.com>
2021-03-03 15:27:19 +08:00
ekexium cc1bbb7c60 doc: ExtractError
Signed-off-by: ekexium <ekexium@gmail.com>
2021-03-03 15:27:19 +08:00
ekexium 212dfd1f2a refactor: rename PropagateError to ExtractError
Signed-off-by: ekexium <ekexium@gmail.com>
2021-03-03 15:27:19 +08:00
ekexium 0e2284c10f style: use macros to reduce duplicated code
Signed-off-by: ekexium <ekexium@gmail.com>
2021-03-03 15:27:11 +08:00
ekexium 5a0386f890 feat: propagate errors in every possible place
Signed-off-by: ekexium <ekexium@gmail.com>
2021-03-02 18:42:40 +08:00
ekexium 4cb0f320e9 feat: add a PropagateError plan
Signed-off-by: ekexium <ekexium@gmail.com>
2021-03-02 18:32:40 +08:00
ekexium c6e72710b7 fix: take_locks return KeyError in responses
Signed-off-by: ekexium <ekexium@gmail.com>
2021-03-02 18:32:30 +08:00
ekexium 740d889253 fix: HasError for Result
Signed-off-by: ekexium <ekexium@gmail.com>
2021-03-02 15:04:03 +08:00
Nick Cameron 3fad149ff3
Merge pull request #232 from nrc/plan
Refactor the command abstraction
2021-02-25 16:31:13 +13:00
Nick Cameron 9a5fd1d8c9 Address review comments
Signed-off-by: Nick Cameron <nrc@ncameron.org>
2021-02-25 15:59:40 +13:00
Nick Cameron 8cb8dd666a Refactor the command-abstraction into a composable plan abstraction
Signed-off-by: Nick Cameron <nrc@ncameron.org>
2021-02-17 13:06:07 +13:00
Nick Cameron 2baddc6158 Add request ctor functions taking high-level types
Signed-off-by: Nick Cameron <nrc@ncameron.org>
2021-02-16 15:25:01 +13:00
Nick Cameron 71dd80e87d Be a little more consistent with the types in request ctor functions
Signed-off-by: Nick Cameron <nrc@ncameron.org>
2021-02-16 15:25:01 +13:00
Nick Cameron 304d8d1243 Move store-related functions from request to store
Signed-off-by: Nick Cameron <nrc@ncameron.org>
2021-02-16 15:25:01 +13:00
Nick Cameron ecab156fec Remove retry_response_stream
Signed-off-by: Nick Cameron <nrc@ncameron.org>
2021-02-16 15:25:01 +13:00
Nick Cameron 56c993357e
Merge pull request #233 from ziyi-yan/support-mutation-insert-checkne
Support mutation Insert and CheckNotExists
2021-02-12 15:59:41 +13:00
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
Ziyi Yan f8a086e801 txn: add CheckNotExist mutation when delete-your-writes happens
Signed-off-by: Ziyi Yan <ziyi.yan@foxmail.com>
2021-02-11 23:05:14 +08:00
Ziyi Yan d3f63fea1c txn: add insert() to Transaction
Signed-off-by: Ziyi Yan <ziyi.yan@foxmail.com>
2021-02-11 23:05:10 +08:00
Nick Cameron c59911a211
Merge pull request #228 from andylokandy/not_founds
Distinguish not existing key and existing key with empty value in get_for_update
2021-02-04 15:26:54 +13:00
ti-srebot 95a682894d
Merge branch 'master' into not_founds 2021-02-01 15:01:41 +08:00
Nick Cameron b4e5d37723
Merge pull request #230 from shenek/doc-fix
Fix warnings when generating docs
2021-01-25 09:22:20 +13:00
Nick Cameron ea97995272
Merge branch 'master' into doc-fix 2021-01-25 09:22:05 +13:00
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