API documentation: https://docs.couchbase.com/sdk-api/couchbase-c-client-3.3.19
Full Changelog: 3.3.18...3.3.19
-
CCBC-1685: Add
lcb_trim_memory()to release cached pool memory. Long-lived instances that occasionally burst and then idle retain the peak working set of every pipeline's internal allocator untillcb_destroy(). In memory-constrained environments (containers, tight cgroup limits) this plateau is easily mistaken for a leak and can trigger the OOM killer once several instances are stacked in one process. The new API releases the backing buffers of cached blocks without touching in-flight operations or connections. Intended for periodic invocation from an application's idle tick when RSS approaches a configured limit. -
CCBC-1702: Requeue operations when the vBucket map briefly has no master. During failover, rebalance, and the moment a new configuration is being installed the vbmap can transiently show no master for a vBucket. Previously such operations failed immediately with
LCB_ERR_NO_MATCHING_SERVER; they are now retried until the operation deadline expires, matching the contract customers expect during topology changes. Opt-out remains available viaretry=missingnode=0. This change also closes several latent use-after-free races on the configuration-replacement path that the longer retry window made reachable. -
CCBC-1699, CCBC-1695, CCBC-1694: Fix TLS +
libuvcrashes and hangs around instance teardown and live configuration updates. Pre-fix symptoms includedSIGABRTin the SSL context destructor on Couchbase Server 7.6 and 6.6, a deadlock inlcb_destroy()that prevented async-destroy callbacks from firing, and a use-after-free crash during rebalance and failover against CBS 6.0.x under TLS. The libuv I/O plugin now caps its teardown drain and force-closes orphaned timers and sockets solcb_destroy_io_ops()no longer hangs or asserts onuv_loop_close. -
CCBC-1686, CCBC-1687, CCBC-1692: Harden the
conn-state-invalidatederror path. A server-side error carrying this errmap attribute (e.g.EINTERNAL0x84) could leave the client exposed to a destroy/refresh race that crashed on Windows IOCP and was a latent use-after-free on Linux. Configuration providers are now paused synchronously at the start oflcb_destroy(), and an inverted guard in the error handler that could deliverLCB_SUCCESSto user callbacks (or clobber a more specific status withLCB_ERR_GENERIC) has been corrected. -
CCBC-1688: Fix use-after-free in the threshold-logging tracer. Host and port tags attached to a span used to point into the owning socket's connection info, which could be freed before the span was finished — for example when a sockpool entry was torn down by its timer while the outer HTTP/View request was still draining. The tracer now copies these short strings.
-
CCBC-1684: Preserve the
deadline >= startinvariant when an operation is re-stamped at flush time. WithLCB_CNTL_RESET_TIMEOUT_ON_WAITenabled and a short per-op timeout, the flush callback could produce a packet withstart > deadlineand abort the process via an assertion on the nextlcb_wait(). Both fields are now rebased to flush time, preserving the remaining timeout budget. -
Fix packet replacement and memory management in the retry queue. When a collection is being flushed and packets are renewed in place, the old packet's bytes can still be referenced by the netbuf PDU queue or an in-flight kernel write. The new
MCREQ_F_REPLACEDflag lets the retry path safely replace such packets without freeing memory that is still on the wire. -
CCBC-1693: Avoid copying the cached collection path on every KV response.
CollectionCache::id_to_namenow returns a stable reference into the cache instead of a freshstd::string, eliminating a per-reply allocation for collection paths longer than the small-string optimisation threshold. -
CCBC-1682: Fix Analytics discovery with Alternate Addresses. When connecting to Couchbase Operational or Enterprise Analytics using
LCB_TYPE_CLUSTER, the client used/poolsStreaming/default, which returns a legacy configuration withoutnodesExtand triggers the 2.x parser fallback. As a result the Analytics service was not discovered, alternate addresses were ignored, and callers sawLCB_ERR_UNSUPPORTED_OPERATION. The cluster-level HTTP bootstrap now uses/pools/default/nodeServicesStreaming. -
CCBC-1678: Deprecate the Views (Map-Reduce) API in public headers. Couchbase Server 7.0 deprecated the Views service in favour of the Query Service (SQL++). All public view entry points now emit
-Wdeprecated-declarationsat call sites with a guiding message. ABI is preserved; existing binaries continue to link and run. Translation units that legitimately use the Views API can opt out by predefiningLCB_DEPRECATE_VIEWS(X)before includingcouchbase.h. -
Honor
op->trytimestrictly when flushing scheduled retries. The previous 5 ms early-fire window could let a retry land below the errmap retry-spec's documented "wait at least N ms before the first retry" floor, observable on slower CI runners. -
CCBC-1689, CCBC-1690, CCBC-1691: Stabilise the test suite around failover/replica-read, libuv-specific timer races, and slow Windows Debug bootstrap. SDK behaviour is unchanged.