Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add ttl for raw client #370

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

add ttl for raw client #370

wants to merge 2 commits into from

Conversation

dmeijboom
Copy link

Based on #324 with the following additions:

  • Rebased on tikv master
  • Changed (KvPair, u64) to KvPairWithTTL

@dmeijboom
Copy link
Author

Seems like the clippy and integration test is failing.

Clippy makes sense:

Error: Unable to create clippy annotations! Reason: HttpError: Resource not accessible by integration
Warning: It seems that this Action is executed from the forked repository.
Warning: GitHub Actions are not allowed to create Check annotations, when executed for a forked repos. See https://github.com/actions-rs/clippy-check/issues/2 for details.

But for the integration tests I'll look into that

Signed-off-by: andylokandy <andylokandy@hotmail.com>
@ycytt-rs
Copy link

batch_put() api would give the following error:

gRPC error: RpcFailure: 13-INTERNAL Failed to deserialize response message: Codec(WireError(UnexpectedWireType(WireTypeLengthDelimited)))

tikv server: v6.1.3

I also tested tikv v4.0. It does not throw this error.

Example:

use tikv_client::{KvPair, RawClient};

#[tokio::main]
async fn main() -> Result<(), ()> {
    let client = RawClient::new(vec!["127.0.0.1:12379"], None).await.unwrap();
    let kvpair1: KvPair = KvPair("PD".to_owned().into(), "Go".to_owned().into());
    let kvpair2: KvPair = KvPair("TiKV".to_owned().into(), "Rust".to_owned().into());
    let pairs: Vec<KvPair> = vec![kvpair1, kvpair2];

    match client.batch_put(pairs).await {
        Ok(_) => println!("pairs are inserted"),
        Err(e) => println!("error: {}", e),
    };

    Ok(())
}

Output:

Dec 12 10:53:08.427 INFO connect to tikv endpoint: "127.0.0.1:20160"
error: gRPC error: RpcFailure: 13-INTERNAL Failed to deserialize response message: Codec(WireError(UnexpectedWireType(WireTypeLengthDelimited)))

@dmeijboom
Copy link
Author

Indeed, that was also my observation. I'm not sure what's going on and I don't have a lot of time to work on this. I'll try to get to the bottom of this in the next couple of days though. If anyone has any clues, please share ;)

@ycytt-rs
Copy link

just a wild guess. It may have something to do with the pb files. Let me also cross check the go client code to see if there is any finding.

@@ -262,18 +274,25 @@ impl<PdC: PdClient> Client<PdC> {
/// # });
/// ```
pub async fn put(&self, key: impl Into<Key>, value: impl Into<Value>) -> Result<()> {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why removed put_ttl in #324?

@andylokandy
Copy link
Collaborator

Apologies for the delayed response. We have transitioned from grpc-cpp to tonic (#399), which should have resolved the issue in this PR. Regrettably, I do not have permission to merge this PR, so I will proceed with merging the previous one at #324. My apologies for any inconvenience caused.

@andylokandy andylokandy mentioned this pull request Dec 18, 2023
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants