diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ea999ee..8aac0e7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -105,6 +105,6 @@ jobs: - name: install tiup run: curl --proto '=https' --tlsv1.2 -sSf https://tiup-mirrors.pingcap.com/install.sh | sh - name: start tiup playground - run: /home/runner/.tiup/bin/tiup playground nightly --mode tikv-slim --kv 3 --monitor false --kv.config /home/runner/work/client-rust/client-rust/config/tikv.toml --pd.config /home/runner/work/client-rust/client-rust/config/pd.toml & + run: /home/runner/.tiup/bin/tiup playground nightly --mode tikv-slim --kv 3 --without-monitor --kv.config /home/runner/work/client-rust/client-rust/config/tikv.toml --pd.config /home/runner/work/client-rust/client-rust/config/pd.toml & - name: integration test run: make integration-test diff --git a/Makefile b/Makefile index d6c7dc3..268dc57 100644 --- a/Makefile +++ b/Makefile @@ -31,6 +31,6 @@ doc: # docker: docker-pd docker-kv tiup: - tiup playground nightly --mode tikv-slim --kv 3 --monitor false --kv.config $(shell pwd)/config/tikv.toml --pd.config $(shell pwd)/config/pd.toml & + tiup playground nightly --mode tikv-slim --kv 3 --without-monitor --kv.config $(shell pwd)/config/tikv.toml --pd.config $(shell pwd)/config/pd.toml & all: check doc test diff --git a/README.md b/README.md index 7a9fb8e..815c693 100644 --- a/README.md +++ b/README.md @@ -137,6 +137,8 @@ Please follow PingCAP's [Rust style guide](https://pingcap.github.io/style-guid ## Getting help -If you need help, either to find something to work on, or with any technical problem, the easiest way to get it is via Slack. We monitor the client-rust (better for general client questions) and sig-transaction (better for technical questions about TiKV's transaction protocol) channels on the [tikv-wg slack](https://tikv.org/chat). +If you need help, either to find something to work on, or with any technical problem, the easiest way to get it is via internals.tidb.io, the forum for TiDB developers. -You can also get help on GitHub issues or PRs directly. You can just ask a question; if you don't get a response, you should ping @nrc or @ekexium. +You can also ask in Slack. We monitor the #client-rust channel on the [tikv-wg slack](https://tikv.org/chat). + +You can just ask a question on GitHub issues or PRs directly; if you don't get a response, you should ping @ekexium or @andylokandy. diff --git a/mock-tikv/src/pd.rs b/mock-tikv/src/pd.rs index 62e948d..61bfae4 100644 --- a/mock-tikv/src/pd.rs +++ b/mock-tikv/src/pd.rs @@ -9,13 +9,11 @@ use tikv_client_proto::pdpb::*; pub const MOCK_PD_PORT: u16 = 50021; /// This is mock pd server, used with mock tikv server. #[derive(Debug, Clone)] -pub struct MockPd { - ts: i64, -} +pub struct MockPd {} impl MockPd { fn new() -> MockPd { - MockPd { ts: 0 } + MockPd {} } fn region() -> tikv_client_proto::metapb::Region { diff --git a/src/pd/client.rs b/src/pd/client.rs index 2d49ac1..8bccbe3 100644 --- a/src/pd/client.rs +++ b/src/pd/client.rs @@ -195,8 +195,8 @@ pub trait PdClient: Send + Sync + 'static { fn decode_region(mut region: RegionWithLeader, enable_codec: bool) -> Result { if enable_codec { - codec::decode_bytes_in_place(&mut region.region.mut_start_key(), false)?; - codec::decode_bytes_in_place(&mut region.region.mut_end_key(), false)?; + codec::decode_bytes_in_place(region.region.mut_start_key(), false)?; + codec::decode_bytes_in_place(region.region.mut_end_key(), false)?; } Ok(region) } diff --git a/src/raw/client.rs b/src/raw/client.rs index 574389e..523e955 100644 --- a/src/raw/client.rs +++ b/src/raw/client.rs @@ -74,7 +74,9 @@ impl Client { /// vec!["192.168.0.100"], /// Config::default().with_timeout(Duration::from_secs(60)), /// None, - /// ).await.unwrap(); + /// ) + /// .await + /// .unwrap(); /// # }); /// ``` pub async fn new_with_config>( diff --git a/src/transaction/client.rs b/src/transaction/client.rs index c7b83a9..fee8e25 100644 --- a/src/transaction/client.rs +++ b/src/transaction/client.rs @@ -51,7 +51,9 @@ impl Client { /// # use tikv_client::{Config, TransactionClient}; /// # use futures::prelude::*; /// # futures::executor::block_on(async { - /// let client = TransactionClient::new(vec!["192.168.0.100"], None).await.unwrap(); + /// let client = TransactionClient::new(vec!["192.168.0.100"], None) + /// .await + /// .unwrap(); /// # }); /// ``` pub async fn new>( @@ -79,7 +81,9 @@ impl Client { /// vec!["192.168.0.100"], /// Config::default().with_timeout(Duration::from_secs(60)), /// None, - /// ).await.unwrap(); + /// ) + /// .await + /// .unwrap(); /// # }); /// ``` pub async fn new_with_config>( @@ -117,7 +121,9 @@ impl Client { /// # use tikv_client::{Config, TransactionClient}; /// # use futures::prelude::*; /// # futures::executor::block_on(async { - /// let client = TransactionClient::new(vec!["192.168.0.100"], None).await.unwrap(); + /// let client = TransactionClient::new(vec!["192.168.0.100"], None) + /// .await + /// .unwrap(); /// let mut transaction = client.begin_optimistic().await.unwrap(); /// // ... Issue some commands. /// transaction.commit().await.unwrap(); @@ -140,7 +146,9 @@ impl Client { /// # use tikv_client::{Config, TransactionClient}; /// # use futures::prelude::*; /// # futures::executor::block_on(async { - /// let client = TransactionClient::new(vec!["192.168.0.100"], None).await.unwrap(); + /// let client = TransactionClient::new(vec!["192.168.0.100"], None) + /// .await + /// .unwrap(); /// let mut transaction = client.begin_pessimistic().await.unwrap(); /// // ... Issue some commands. /// transaction.commit().await.unwrap(); @@ -160,7 +168,9 @@ impl Client { /// # use tikv_client::{Config, TransactionClient, TransactionOptions}; /// # use futures::prelude::*; /// # futures::executor::block_on(async { - /// let client = TransactionClient::new(vec!["192.168.0.100"], None).await.unwrap(); + /// let client = TransactionClient::new(vec!["192.168.0.100"], None) + /// .await + /// .unwrap(); /// let mut transaction = client /// .begin_with_options(TransactionOptions::default().use_async_commit()) /// .await @@ -190,7 +200,9 @@ impl Client { /// # use tikv_client::{Config, TransactionClient}; /// # use futures::prelude::*; /// # futures::executor::block_on(async { - /// let client = TransactionClient::new(vec!["192.168.0.100"], None).await.unwrap(); + /// let client = TransactionClient::new(vec!["192.168.0.100"], None) + /// .await + /// .unwrap(); /// let timestamp = client.current_timestamp().await.unwrap(); /// # }); /// ``` diff --git a/src/transaction/transaction.rs b/src/transaction/transaction.rs index bf0c6a7..43a2adb 100644 --- a/src/transaction/transaction.rs +++ b/src/transaction/transaction.rs @@ -49,7 +49,9 @@ use tokio::{sync::RwLock, time::Duration}; /// # use tikv_client::{Config, TransactionClient}; /// # use futures::prelude::*; /// # futures::executor::block_on(async { -/// let client = TransactionClient::new(vec!["192.168.0.100"], None).await.unwrap(); +/// let client = TransactionClient::new(vec!["192.168.0.100"], None) +/// .await +/// .unwrap(); /// let mut txn = client.begin_optimistic().await.unwrap(); /// let foo = txn.get("foo".to_owned()).await.unwrap().unwrap(); /// txn.put("bar".to_owned(), foo).await.unwrap();