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
[Bug]: There is no way to test Transactions with CouchbaseContainer #5835
Comments
The core issue here is that a bucket by default gets created with replicas=1, which is a sensible default for production clusters. But on single-node clusters (which a CouchbaseContainer effectively is), it's not a valid setting. Most operations work regardless, but durable KV ops do not - reporting the DurabilityImpossibleException error seen. And transactions uses durable KV ops under the hood. So - I think I agree that we should default to setting the number of replicas on the bucket to 0. |
I agree - working on a PR to make it configurable and default to 0. |
This change allows the user to configure the number of bucket replicas and defaults it to 0 since most of the time the user ever only needs no replicas since it is a single container. Note: technically this is a behavioral change since before the number of replicas was 1 (if not defined) but this causes issues when testing transactions (as seen in testcontainers#5835). Fixes testcontainers#5835
This change allows the user to configure the number of bucket replicas and defaults it to 0 since most of the time the user ever only needs no replicas since it is a single container. Note: technically this is a behavioral change since before the number of replicas was 1 (if not defined) but this causes issues when testing transactions (as seen in testcontainers#5835). Fixes testcontainers#5835
This change allows the user to configure the number of bucket replicas and defaults it to 0 since most of the time the user ever only needs no replicas since it is a single container. Note: technically this is a behavioral change since before the number of replicas was 1 (if not defined) but this causes issues when testing transactions (as seen in #5835). Fixes #5835
Module
Couchbase
Testcontainers version
1.17.3
Using the latest Testcontainers version?
Yes
Host OS
Windows
Host Arch
x86
Docker version
What happened?
There is no way to test Transactions with CouchbaseContainer.
Fails with "DurabilityImpossibleException:
With the current cluster configuration, the requested durability guarantees are impossible"
Therefore, a proper solution is impossible.
Demonstration code see Problem 1:
https://github.com/spirostz/couchbase-transactions/blob/main/src/test/java/org/spiros/CouchbaseTransactionsTest.java
Relevant log output
No response
Additional Information
Demonstration code see Problem 1:
https://github.com/spirostz/couchbase-transactions/blob/main/src/test/java/org/spiros/CouchbaseTransactionsTest.java
The text was updated successfully, but these errors were encountered: