Override minimumDurabilityLevel of bucket in upsert call

I have a bucket with minimumDurabilityLevel: majorityAndPersistActive. Is it possible to perform an upsert call from the java SDK where I override the durability so “none” is used?

There seems to be no difference in the created object between setting durability none (UpsertOptions.upsertOptions().durability(DurabilityLevel.NONE)) and not setting it at all (UpsertOptions.upsertOptions()), the durabilityLevel is set to Optional.empty in both cases. So my guess is that it is not possible to override the durability this way at least.

No, you can’t. Logically the bucket attribute is the minimum durability level.

Specifically https://docs.couchbase.com/server/current/learn/data/durability.html#specifying-levels notes:

A level assigned to a bucket is subsequently enforced as the minimum level at which all writes to the bucket occur. Therefore:
[…]
If a level is specified by the client, and a level has also been assigned to the bucket, the higher level is enforced.

(Bold only for emphasis here.)

HTH.

Thanks! I had somehow missed that part of the documentation when reading through that page. It would be even better if this was part of the client SDK documentation as well!

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.