Commit Graph

882 Commits

Author SHA1 Message Date
ekexium b317ab73cb Merge remote-tracking branch 'upstream/master' into unify-locking 2021-04-14 14:37:40 +08:00
ekexium 624a53b8d7 refactor: rename to 'get_primary_key_or_insert'
Signed-off-by: ekexium <ekexium@gmail.com>
2021-04-14 14:19:38 +08:00
ekexium bdf020f76b Merge remote-tracking branch 'upstream/master' into pessimistic-lock-primary-key
Signed-off-by: ekexium <ekexium@gmail.com>
2021-04-14 14:05:12 +08:00
Nick Cameron 2baa2a192b
Merge branch 'master' into allow-rollback-after-commit-failure 2021-04-14 15:51:44 +12:00
Nick Cameron 0314d636ba
Merge pull request #253 from nrc/unlock-delete
Fix two bugs with insert and delete
2021-04-14 13:35:10 +12:00
Nick Cameron e8a9175adb Fix two bugs with insert and delete
Fixes #234

Signed-off-by: Nick Cameron <nrc@ncameron.org>
2021-04-14 11:40:34 +12:00
ekexium 53eb27d92c fix: allow txn to rollback after commit failed
Signed-off-by: ekexium <ekexium@gmail.com>
2021-04-13 10:54:56 +08:00
ekexium d3e5ffbde1 feat: make get_for_update work for optimistic txns
Signed-off-by: ekexium <ekexium@gmail.com>
2021-04-12 15:58:48 +08:00
ekexium 8ba16a085a fix: remove the Mutex in Buffer
Signed-off-by: ekexium <ekexium@gmail.com>
2021-04-09 18:21:38 +08:00
ekexium fc47bb93b6 fix: don't set primary key in a pessimistic lock request until it succeeds
Signed-off-by: ekexium <ekexium@gmail.com>
2021-04-09 16:50:26 +08:00
Nick Cameron 4870985dcd
Merge pull request #252 from ekexium/batch-get-for-update
Fix batch_get_for_update
2021-04-09 14:19:56 +12:00
Nick Cameron c61551c4ad
Merge branch 'master' into batch-get-for-update 2021-04-09 14:19:26 +12:00
Nick Cameron 9320198ab1 Deny warnings on CI
Signed-off-by: Nick Cameron <nrc@ncameron.org>
2021-04-09 14:10:13 +12:00
ekexium 6f6834a428 test: read fewer keys in txn_write_million to satisfy grpc message size limit
Signed-off-by: ekexium <ekexium@gmail.com>
2021-04-07 17:33:20 +08:00
ekexium 4120b76455 style: resolve comments
Signed-off-by: ekexium <ekexium@gmail.com>
2021-03-18 14:28:43 +08:00
ekexium d789cc650b Merge remote-tracking branch 'upstream/master' into batch-get-for-update
Signed-off-by: ekexium <ekexium@gmail.com>
2021-03-15 18:48:43 +08:00
ekexium 24af21c3b9 test: don't test 1pc until we fix it
Signed-off-by: ekexium <ekexium@gmail.com>
2021-03-15 18:34:56 +08:00
ekexium 260bcd70cd test: test multi-region batch_get_for_update
Signed-off-by: ekexium <ekexium@gmail.com>
2021-03-15 16:15:33 +08:00
ekexium 555981eae7 doc: update
Signed-off-by: ekexium <ekexium@gmail.com>
2021-03-15 15:23:25 +08:00
ekexium a3f814ab1f feat: fix batch_get_for_update
Signed-off-by: ekexium <ekexium@gmail.com>
2021-03-12 15:58:47 +08:00
Zijie Lu 486a4b2e14
Automatic heartbeat (#236)
* Remove retry_response_stream

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

* Move store-related functions from request to store

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

* Be a little more consistent with the types in request ctor functions

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

* Add request ctor functions taking high-level types

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

* Refactor the command-abstraction into a composable plan abstraction

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

* Support sending heartbeats automatically

Signed-off-by: Zijie Lu <wslzj40@gmail.com>

* nitpick

Signed-off-by: Zijie Lu <wslzj40@gmail.com>

* Add heartbeat check

Signed-off-by: Zijie Lu <wslzj40@gmail.com>

* Fix use

Signed-off-by: Zijie Lu <wslzj40@gmail.com>

* fix

Signed-off-by: Zijie Lu <wslzj40@gmail.com>

* fix complie errors

Signed-off-by: Zijie Lu <wslzj40@gmail.com>

* Address review comments

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

* remove heartbeat plan and use spawn

Signed-off-by: Zijie Lu <wslzj40@gmail.com>

* Fix build errors and replace RwLock

Signed-off-by: Zijie Lu <wslzj40@gmail.com>

* Address review comments

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

* Add unit test

Signed-off-by: Zijie Lu <wslzj40@gmail.com>

* nitpick

Signed-off-by: Zijie Lu <wslzj40@gmail.com>

* nitpick

Signed-off-by: Zijie Lu <wslzj40@gmail.com>

* Fix deadlock and unit tests

Signed-off-by: Zijie Lu <wslzj40@gmail.com>

* Add test for optimistic_heart

Signed-off-by: Zijie Lu <wslzj40@gmail.com>

* Add mod.rs for tests

Signed-off-by: Zijie Lu <wslzj40@gmail.com>

* Fix failpoint tests

Signed-off-by: Zijie Lu <wslzj40@gmail.com>

* Address review comments

Signed-off-by: Zijie Lu <wslzj40@gmail.com>

* Address review comments

Signed-off-by: Zijie Lu <wslzj40@gmail.com>

* Address review comments

Signed-off-by: Zijie Lu <wslzj40@gmail.com>

* Fix tests

Signed-off-by: Zijie Lu <wslzj40@gmail.com>

* Fix clippy errors

Signed-off-by: Zijie Lu <wslzj40@gmail.com>

* Address review comments

Signed-off-by: Zijie Lu <wslzj40@gmail.com>

* Remove bg_worker

Signed-off-by: Andy Lok <andylokandy@hotmail.com>

* Fix test

Signed-off-by: Zijie Lu <wslzj40@gmail.com>

* rename to failpoint_tests

Signed-off-by: Zijie Lu <wslzj40@gmail.com>

* Update transaction.rs

* Update transaction.rs

Signed-off-by: Andy Lok <andylokandy@hotmail.com>

Co-authored-by: Nick Cameron <nrc@ncameron.org>
Co-authored-by: Andy Lok <andylokandy@hotmail.com>
2021-03-11 11:01:36 +13:00
Nick Cameron 405535c777
Merge pull request #248 from ekexium/reduce-panic
Reduce some panics
2021-03-10 08:59:10 +13:00
ekexium 1af4717b12 reduce panics
Signed-off-by: ekexium <ekexium@gmail.com>
2021-03-09 16:43:20 +08:00
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