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

error UnexpectedWriteType("CAS")) with multiple tokio tasks #112

Closed
devrandom opened this issue Sep 22, 2022 · 10 comments
Closed

error UnexpectedWriteType("CAS")) with multiple tokio tasks #112

devrandom opened this issue Sep 22, 2022 · 10 comments
Labels
enhancement New feature or request
Milestone

Comments

@devrandom
Copy link

I am getting error UnexpectedWriteType("CAS")) when doing batch inserts from multiple tasks in the same Session object.

It fails intermittently on a three node cluster with Cassandra version [cqlsh 6.0.0 | Cassandra 4.0.5 | CQL spec 3.4.5 | Native protocol v5]. It works consistently with a single task.

On a local Cassandra instance in docker, it work consistently with multiple tasks - version 4.0.6.

@krojew krojew added the bug Something isn't working label Sep 22, 2022
@krojew
Copy link
Owner

krojew commented Sep 22, 2022

Can you check with protocol v4?

@devrandom
Copy link
Author

Do you mean downgrade to an old Cassandra? or is there a way to make it fall back to the older protocol?

@krojew
Copy link
Owner

krojew commented Sep 22, 2022

You can specify the protocol version when building connection configuration: https://docs.rs/cdrs-tokio/7.0.0/cdrs_tokio/cluster/struct.NodeTcpConfigBuilder.html#method.with_version

@devrandom
Copy link
Author

devrandom commented Sep 22, 2022

It happens with V3, V4 and V5. Less often in the older protocol versions.

@devrandom
Copy link
Author

Also, wanted to mention that this is an LWT batch. The code in question is here: https://gitlab.com/lightning-signer/validating-lightning-signer/-/merge_requests/312/diffs#144ee5d06667bb53830287a66cd0bda0b514e40c_0_319 (look for async fn put if I push again and invalidate the line locator)

@devrandom
Copy link
Author

The scylla driver gives me a more detailed error: Scylla(QueryError(DbError(WriteTimeout { consistency: Serial(LocalSerial), received: 1, required: 2, write_type: Cas }, "Operation timed out - received only 1 responses.")))'

So cdrs is probably getting confused by the write_type on this error.

Well, I'm confused by this error myself...

@krojew
Copy link
Owner

krojew commented Sep 23, 2022

If you're getting it on a two different drivers, it means a problem in your cluster.

@krojew krojew removed the bug Something isn't working label Sep 23, 2022
@devrandom
Copy link
Author

agreed. however, the cdrs driver does eat part of the error - would be good to fix.

@krojew
Copy link
Owner

krojew commented Sep 23, 2022

Sure, I'll take a look.

@krojew krojew added the enhancement New feature or request label Sep 24, 2022
@krojew krojew added this to the 8.0.0 milestone Sep 24, 2022
@krojew
Copy link
Owner

krojew commented Sep 24, 2022

This turns out to be a braking change and will be included in the next major version.

krojew added a commit that referenced this issue Sep 27, 2022
@krojew krojew closed this as completed Oct 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants