Commit Graph

154 Commits

Author SHA1 Message Date
Yilin Chen 2733e28ece
Merge pull request #92 from sticnarf/fix-tso
Use a new TSO client implementation
2019-08-06 12:29:28 +08:00
Yilin Chen c64281fbd4 Refine some docs
Signed-off-by: Yilin Chen <sticnarf@gmail.com>
2019-08-05 20:44:45 +08:00
Yilin Chen 31511aa9f0 Do some refactoring and add some more docs
Signed-off-by: Yilin Chen <sticnarf@gmail.com>
2019-08-05 16:04:38 +08:00
Yilin Chen aea6538919
Clarify that the abbreviation TSO refers to timestamp oracle
Signed-off-by: Yilin Chen <sticnarf@gmail.com>
2019-08-01 10:57:24 +08:00
Yilin Chen 8f6479b9ad
Address CI warnings and some comments
Signed-off-by: Yilin Chen <sticnarf@gmail.com>
2019-08-01 10:32:12 +08:00
Yilin Chen 3522d33696
Fix CI by changing PD_ADDR to PD_ADDRS
Signed-off-by: Yilin Chen <sticnarf@gmail.com>
2019-08-01 02:44:18 +08:00
Yilin Chen 52ea5dd600
Fix CI by changing PD_ADDR to PD_ADDRS
Signed-off-by: Yilin Chen <sticnarf@gmail.com>
2019-08-01 02:08:31 +08:00
Yilin Chen 463a03fc9b
Merge branch 'master' into fix-tso 2019-08-01 02:06:27 +08: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
Shirly 91bc7f637f
Use async/await in the transaction APIs (#91)
Use async/await in the transaction APIs
2019-07-31 17:05:50 +08:00
Yilin Chen 4ce0844280
Fix a clippy bug by upgrading toolchain version
Signed-off-by: Yilin Chen <sticnarf@gmail.com>
2019-07-31 16:38:16 +08:00
Yilin Chen ebcf7d4469
Address comments
Signed-off-by: Yilin Chen <sticnarf@gmail.com>
2019-07-31 16:10:32 +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
Yilin Chen 5a0b6feddf Use async/await in the transaction APIs
After this commit, the library requires a nightly Rust compiler to build.

The required toolchain version is also updated in README.md and .travis.yml.

Signed-off-by: Yilin Chen <sticnarf@gmail.com>
2019-07-31 13:53:57 +08:00
Yilin Chen b7a9441815
Merge pull request #88 from sticnarf/no-custom-timestamp
Replace begin_with_timestamp with snapshot_at
2019-07-31 11:44:08 +08:00
Yilin Chen 033e13da1a
Fix warnings
Signed-off-by: Yilin Chen <sticnarf@gmail.com>
2019-07-30 16:24:57 +08:00
Yilin Chen 934cce8785
Replace begin_with_timestamp with snapshot_at.
Users should not be able to begin a transaction with a custom timestamp.
If there were two transactions running with the same start TS, data could
be corrupted. However, a read-only snapshot with a custom timestamp is OK.

Signed-off-by: Yilin Chen <sticnarf@gmail.com>
2019-07-30 15:40:08 +08:00
Nick Cameron 010fd4bea0 test group_tasks_by_region (#86)
Signed-off-by: Nick Cameron <nrc@ncameron.org>
2019-07-25 11:22:01 -07:00
Brian Anderson abc39fe10f
Merge pull request #85 from nrc/deps
Update deps and fix the build
2019-07-24 12:36:40 -07:00
Nick Cameron 800d3b02dc Update deps and fix the build
Signed-off-by: Nick Cameron <nrc@ncameron.org>
2019-07-25 07:07:50 +12:00
Nick Cameron b66a310ecf Implement a unit test by mocking lower level clients (#81)
* Move Contexts from rpc/client to rpc

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

* Refactor rpc/pd

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

* Add a test for `RpcClient::kv_client`

This serves as a template for a testing strategy using mocks. This commit abstracts
and mocks the PdClient, then uses that to mock the RpcClient and thus test `kv_client`.
The test itself is not too interesting.

Signed-off-by: Nick Cameron <nrc@ncameron.org>
2019-07-23 15:01:16 -07:00
Yilin Chen c13f63398e Upgrade rustc version to solve cargo doc failure (#83)
Signed-off-by: Yilin Chen <sticnarf@gmail.com>
2019-07-16 11:05:32 -07:00
Nick Cameron 7bc06c062b
Merge pull request #80 from nrc/kv-ref-into
Don't implement From<&'static str> for Key and Value
2019-07-12 15:18:19 +12:00
Nick Cameron 0ed7c8afe3 Introduce ToOwnedRange to make handling ranges a bit nicer
Signed-off-by: Nick Cameron <nrc@ncameron.org>
2019-07-12 14:59:45 +12:00
Nick Cameron 426d596709 Remove From impls for Key and Value
Closes #61

Signed-off-by: Nick Cameron <nrc@ncameron.org>
2019-07-12 14:40:42 +12:00
Nick Cameron e8b04a9715
Merge pull request #79 from nrc/ts
Some more refactoring
2019-07-12 14:39:33 +12:00
Nick Cameron 35fe306172 Fix the build
Needed to pin the compiler to work around a compiler bug which manifests in syn.

Changes to work with futures 3.0.17.

Use latest Prost from the Git repo so we get the same version as kvproto

Use lazy_static 1.0 to avoid deprecation warnings.

Satisfy Clippy on `Err(...)?`

Signed-off-by: Nick Cameron <nrc@ncameron.org>
2019-07-12 14:09:18 +12:00
Nick Cameron e9c16deca9 trim some fat around the region types
Signed-off-by: Nick Cameron <nrc@ncameron.org>
2019-07-12 10:38:05 +12:00
Nick Cameron 4dba98b9d3 Remove unused getter
Signed-off-by: Nick Cameron <nrc@ncameron.org>
2019-07-12 10:38:05 +12:00
Nick Cameron 3e44759e39 Remove duplicate timestamp type
Signed-off-by: Nick Cameron <nrc@ncameron.org>
2019-07-12 10:38:05 +12:00
Ana Hobden 1815a3bf54
Add proptest support (#68)
* Add proptest support

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

* fmt

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

* Make proptest feature more consistent

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

* Fixes #69

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

* fmt

Signed-off-by: Ana Hobden <operator@hoverbear.org>
2019-07-04 17:35:11 -07:00
Nick Cameron 75eae033a7 Remove toolchain special casing (#78)
Since various bugs are fixed upstream

Closes #55

Signed-off-by: Nick Cameron <nrc@ncameron.org>
2019-07-02 12:18:48 -07:00
Nick Cameron 7bdaeae2a5
Merge pull request #77 from nrc/deref
Remove `Deref` impls for Keys and Values
2019-07-02 11:13:58 +12:00
Nick Cameron eaff4919e9 Remove Defer impls for Keys and Values
Closes #76

Signed-off-by: Nick Cameron <nrc@ncameron.org>
2019-06-28 14:41:17 +12:00
Nick Cameron 2ea6ecc45b
Merge pull request #73 from nrc/box-futures
Refactor everything
2019-06-28 13:16:38 +12:00
Nick Cameron fb55c458c4 Restore Transaction::new example/docs
Signed-off-by: Nick Cameron <nrc@ncameron.org>
2019-06-25 14:29:27 +12:00
Nick Cameron 5d6175a1c0 Address some CI issues
Signed-off-by: Nick Cameron <nrc@ncameron.org>
2019-06-24 13:53:16 +12:00
Nick Cameron 21f4f13d99 Replace into_inner with Into impls
Signed-off-by: Nick Cameron <nrc@ncameron.org>
2019-06-24 10:42:21 +12:00
Nick Cameron 6cdb012d48 Use derive(new) in a few more places
Signed-off-by: Nick Cameron <nrc@ncameron.org>
2019-06-24 10:42:21 +12:00
Nick Cameron 26cf1daf69 Remove RpcClientInner
Signed-off-by: Nick Cameron <nrc@ncameron.org>
2019-06-24 10:42:21 +12:00
Nick Cameron f1e8b34f5a Address type-length limit in raw example
Signed-off-by: Nick Cameron <nrc@ncameron.org>
2019-06-24 10:42:21 +12:00
Nick Cameron cfa5f8e34d Replace a Loop closure with a Stream in rpc/client
Signed-off-by: Nick Cameron <nrc@ncameron.org>
2019-06-24 10:42:21 +12:00
Nick Cameron d77340374f Remove a helper method and move a private method
Signed-off-by: Nick Cameron <nrc@ncameron.org>
2019-06-24 10:42:21 +12:00
Nick Cameron c147ac6ff1 Refactor ScanRegionsContext
Signed-off-by: Nick Cameron <nrc@ncameron.org>
2019-06-24 10:42:21 +12:00
Nick Cameron d4789ddec9 Don't pass an arg in and out of kv_client
Signed-off-by: Nick Cameron <nrc@ncameron.org>
2019-06-24 10:42:21 +12:00
Nick Cameron 4ad75c5bc7 Refactor RequestState etc to not need existential types
Signed-off-by: Nick Cameron <nrc@ncameron.org>
2019-06-24 10:42:21 +12:00
Nick Cameron 6416d5a0ed Avoid boxing futures
Signed-off-by: Nick Cameron <nrc@ncameron.org>
2019-06-24 10:42:21 +12:00
Nick Cameron f9ddd4a564 Remove some glob imports
Signed-off-by: Nick Cameron <nrc@ncameron.org>
2019-06-24 10:42:21 +12:00
Nick Cameron 56bddc2598
Merge pull request #72 from nrc/mods
Split raw and transaction into smaller modules
2019-06-21 16:25:21 +12:00
Nick Cameron b578f63bee Fixup privacy in raw::requests
Signed-off-by: Nick Cameron <nrc@ncameron.org>
2019-06-21 15:58:47 +12:00