Hello Team,
What is the default setting for durability in Spring Data Couchbase ?
If consistency is defined as Strong, does it has any impact on Durability ?
What is the best way to define durability if we are using - ReactiveCouchbaseSortingRepository -> save() method ?
Thanks,
Suyash
Hi,
Default durability is NONE (it only persists in the server in responsible for the vBucket) but it is mostly used on transactions. https://docs.couchbase.com/server/current/learn/data/durability.html#:~:text=Couchbase%20Server%20supports%20durability%20for%20up%20to%20two%20replicas%3A%20it,to%20a%20bucket%2C%20or%20both .
Saves/Updates/Deletes are strongly consistent by default on Couchbase. But if you need to query the object saved right after, then you need to set your Scan Consistency to REQUEST_PLUS. By default the scan consistency is NOT_BOUNDED.
On spring data couchbase 4 you can use the annotation ScanConsistency(query = QueryScanConsistency.REQUEST_PLUS) , and I think that we might have a config somewhere to set REQUEST_PLUS as the default
Hi,
How do I set QueryScanConsistency.REQUEST_PLUS as the default? I can’t find any config.
I’m looking for the very same information !
My tests randomly fail because of the default scan consistency.
Provided with
opened 07:20PM - 30 Sep 21 UTC
closed 06:42PM - 22 Oct 21 UTC
type: regression
type: enhancement
According to the documentation, the default consistency level for Repositories i… s `NOT_BOUNDED` ( https://docs.spring.io/spring-data/couchbase/docs/current/reference/html/#couchbase.repository.consistency ).
This is fine for some environment, but not for others. Typically during tests, most of them fail because they try to read their own writes, and it fails.
With a previous version of Spring Data Couchbase based on SDK 2.x we could extend `getDefaultConsistency()` from `AbstractCouchbaseConfiguration`. This method is now gone and as we are migrating, it breaks our app. No green tests, no delivery.
Override this method in your configuration class:
public QueryScanConsistency getDefaultConsistency() {
return null;
}