Version 2.1.2 is the second bug fix release of the 2.1 series. It contains bug
fixes and correctness improvements, especially related to durability requirements,
streaming parsers and unstable cluster behavior.
New features and behavioral changes
This release contains the following enhancements:
- JCBC-729: Decoding JSON long numbers has been made more
performant because it does not go through a catch block on parsing an int value
- JCBC-724: The environment configuration dump on startup
now also includes the settings from the CouchbaseEnvironment, not
just the CoreEnvironment.
- JCBC-725: The N1QL metrics are now exposed as a
strongly typed QueryMetrics object instead of the more generic
JsonObject object. It provides direct method access to
parameters like executionTime, resultSize and
- JCBC-735: The signature field returned
by the server can be more than just a JsonObject, so the parsing
has been modified and it is now exposed as a more generic Object
- JVMCBC-168: Nagle's algorithm is now disabled by
default, providing slightly better performance especially when lots of small
packets are sent (for example, under get-heavy workloads).
- JVMCBC-170: A hard minimum pool size for both the I/)
and computation pools of 3 is now enforced to avoid resource starvation if either
the operating system returns a very small CPU count or it is configured lower than
the boundary. An INFO level message is logged as well.
- JVMCBC-167: An environment configuration option has
been added that allows you to disable the buffer pooling. While not recommended in
general, it can be a helpful switch if there is an indication that the SDK is
leaking memory. If pooling is disabled, a higher garbage collection pressure is
expected. It can be disabled like this:
CouchbaseEnvironment env = DefaultCouchbaseEnvironment
- JCBC-554: A new experimental utility class is provided
that greatly simplifies asynchronous retry logic. By using this class, you can
specify in a builder-like fashion the type of exceptions to retry and the retry
interval. The following example configures the application to retry
BackpressureException exceptions at 10 millisecond intervals
with a maximum of 8 retries allowed, but lets all other exceptions pass through
without being retried:
import static com.couchbase.client.java.util.retry.RetryBuilder.anyOf;
.flatMap(id -> bucket.upsert(JsonDocument.create(id, JsonObject.empty())))
This release fixes the following issues:
- JVMCBC-171: The regression introduced in 2.1.1 has been
fixed where the SDK tries to connect to localhost, even when the
nodes are running on remote servers. The issue only showed up in the combination
of SDK 2.1.1 with Couchbase Server 3.0.0, 3.0.1 (all platforms) and 3.0.2
- JVMCBC-154, JVMCBC-163, JVMCBC-177: Multiple fixes for various rebalance and
failure scenarios have been implemented in the core layer to react more
deterministically. Especially parallel configuration pulling from various other
nodes has been improved as well as continuous configuration polling after every
failed reconnect attempt has been added.
- JCBC-728, JCBC-731: The JsonLongDocument is now
fully interoperable when used together on the mutation methods and the counter
method. Previously, there were issues when a value written by the counter method
was read by get and vice versa. In addition, the counter method
now correctly uses the documented default value of 0 as advertised in the
- JVMCBC-166, JVMCBC-175: Durability constraints
(ReplicateTo, PersistTo) internals have been
reworked and are now correct. In particular, they take the returned CAS value into
account to make sure only success is reported when the document is overwritten on
the replica. In addition, the active partition is always polled (even when not
explicitly needed) to correctly determine concurrent modifications of the same
- JCBC-723: When a touch operation does
not find the document with the given ID, it now properly throws a
DocumentDoesNotExistException. Previously, a generic exception
was thrown that did not hold the semantical information needed to react properly
on the application side.
- JVMCBC-165: Thanks to a user contribution, the client
now never adds line breaks on internal HTTP Basic auth requests against the
configuration or view service (and in the future the N1QL service).
- JVMCBC-176, JCBC-740: In the AsyncViewResponse
errors are now exposed as an Observable because they can also
come after the emitted rows in the response. The core layer has been modified to
take this into account and the java binding reflects the change. The blocking API
has not changed.
- JVMCBC-172, JVMCBC-174: Two parsing issues have been fixed in the
N1QL streaming parser. It now correctly decodes all possible JSON ways of a
signature and also it properly waits for the actual last chunk of the query
response before accepting a new request. This mitigates some errors and a form of
a race condition that was showing up in continuous N1QL requests.
- JVMCBC-173: Internal DCP compatibility has been
restored which was broken in the last versions. It now uses a special form of a
transient endpoint and works again.