Skip to content

Tags: couchbase/libcouchbase

Tags

3.3.19

Toggle 3.3.19's commit message

Verified

This tag was signed with the committer’s verified signature.
avsej Sergey Avseyev
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 until
  `lcb_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 via
  `retry=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 + `libuv` crashes and hangs
  around instance teardown and live configuration updates. Pre-fix
  symptoms included `SIGABRT` in the SSL context destructor on
  Couchbase Server 7.6 and 6.6, a deadlock in `lcb_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 so `lcb_destroy_io_ops()` no longer
  hangs or asserts on `uv_loop_close`.

* CCBC-1686, CCBC-1687, CCBC-1692: Harden the `conn-state-invalidated`
  error path. A server-side error carrying this errmap attribute
  (e.g. `EINTERNAL` 0x84) 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 of `lcb_destroy()`, and an inverted
  guard in the error handler that could deliver `LCB_SUCCESS` to
  user callbacks (or clobber a more specific status with
  `LCB_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 >= start` invariant when an
  operation is re-stamped at flush time. With
  `LCB_CNTL_RESET_TIMEOUT_ON_WAIT` enabled and a short per-op timeout,
  the flush callback could produce a packet with `start > deadline`
  and abort the process via an assertion on the next `lcb_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_REPLACED` flag 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_name` now returns a stable
  reference into the cache instead of a fresh `std::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 without `nodesExt` and
  triggers the 2.x parser fallback. As a result the Analytics
  service was not discovered, alternate addresses were ignored, and
  callers saw `LCB_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-declarations` at 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 predefining `LCB_DEPRECATE_VIEWS(X)` before including
  `couchbase.h`.

* Honor `op->trytime` strictly 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.

3.3.18

Toggle 3.3.18's commit message

Verified

This tag was signed with the committer’s verified signature.
avsej Sergey Avseyev
3.3.18

* CCBC-1672: Fixed protocol violation on new connections.
  In certain cases, extra bytes could be sent at the start of a new connection.
  Most of the time, this caused the server to drop the connection and the
  client would reconnect automatically, so users did not notice. However, in
  rare cases the server would accept the data as valid, leading to protocol
  issues. This has been corrected so that invalid data is properly discarded
  and connections stay consistent.

* CCBC-1671: Send requests to all replica nodes for strategy "ANY".
  This change makes implementation of `get_any_replica` behave the same way as
  other SDKs.

  - The old behavior: "get any replica" would send requests sequentially one by
    one. So that next request will be dispatched only when previous fails.

  - The new behavior: "get any replica" send requests to active and replica
    nodes simulaneously and returns only first response to the user, discarding
    everything else.

* CCBC-1669: Fail `get_all_replicas` only if none nodes are available.

* CCBC-1668: Do not assume that missing active node means none available for
  replica read. With this change reading replica will be more reliable during
  failover and rebalance events.

* CCBC-1667: Do not schedule config update during instance termination. This
  change fixes use-after-free during `lcb_destroy`.

* CCBC-1674: Do not use non-owning spans to release memory with `NETBUF_LIBC_PROXY`.
  Fix use-after-free for build with `NETBUF_LIBC_PROXY` when snappy compression
  is enabled. This is special build when caching allocator is replaced with
  just libc malloc. It is used only during development and testing, and never
  enabled in production.

* CCBC-1673: Do not return block with `deallocs` as free in `find_free_block`
  of the netbuf subsystem.

* Raise minimum cmake version to 3.17

* Log local port to make it easier to correlate logs with the server

3.3.17

Toggle 3.3.17's commit message

Verified

This tag was signed with the committer’s verified signature.
avsej Sergey Avseyev
3.3.17

* CCBC-1666: Do not schedule config request during shutdown. With
  completion-based IO (libuv, Windows IOCP), the library might try to schedule
  configuration update on already deallocated pipeline and cause
  use-after-free condition.

3.3.16

Toggle 3.3.16's commit message

Verified

This tag was signed with the committer’s verified signature.
avsej Sergey Avseyev
3.3.16

* CCBC-1664: Register read event watcher for KV socket if duplex is enabled.
  Fixes missing configuration updates on newer server versions (7.6.5+).

* CCBC-1662: Ignore server-side notification during bootstrap.
  Libcouchbase reports protocol error and stop bootstrapping the connection if
  the server sends configuration notification during the initial handshake.

* Define `LCB_CC_STRING` for MS VS 17 to fix packaging scripts.

* CCBC-1658: Add support for encrypted TLS keys.
  The key password should be specified in connection options with
  `lcb_createopts_tls_key_password()`.

3.3.15

Toggle 3.3.15's commit message

Verified

This tag was signed with the committer’s verified signature.
avsej Sergey Avseyev
3.3.15

* CCBC-1652: Allow to force SASL when client certificate is being used.

3.3.14

Toggle 3.3.14's commit message

Verified

This tag was signed with the committer’s verified signature.
avsej Sergey Avseyev
3.3.14

* CCBC-1653: Fix setting timeout for analytics query.
* CCBC-1651: Ensure that purged packets get their memory released, it
  fixes memory leak in case of network issues.
* CCBC-1646: Server groups for replica reads.
* CCBC-1555: Remove extra prefix in tapset probes.
* CCBC-1598: Fix documentation for cbc tools.
* Fix tests on 7.6 server

3.3.13

Toggle 3.3.13's commit message

Verified

This tag was signed with the committer’s verified signature.
avsej Sergey Avseyev
3.3.13

* CCBC-1647: Handle server-side query timeout (status 1080).

* CCBC-1643: fix memory leak of pending buffers in IO context.

* CCBC-1645: do not use explicit initialization for OpenSSL 1.1+.

* Fix build with `-DLCB_DUMP_PACKETS=ON`

* Fix pkg-config for MacOS

3.3.12

Toggle 3.3.12's commit message

Verified

This tag was signed with the committer’s verified signature.
avsej Sergey Avseyev
3.3.12

* CCBC-1636: Deallocate old packet when updating collection ID.
  mcreq_renew_packet() requires the caller to deallocate original copy,
  otherwise the memory will be only released by pipeline destructor.

* CCBC-1634: Fix reporting unresponsive nodes in lcb_ping().
  * do not retry NOOP commands, as they might be routed to different
    pipeline, instead fail fast NOOPs to reflect network issues more
    precisely.
  * use pipeline address as ping entry identifier instead of socket
    address, as socket might not be existing (not connected) due to
    network failures.
  * lcb_ping still have report even when overall status is not
    LCB_SUCCESS, so cbc-ping should still try to print report instead
    just printing overall status code.

* CCBC-1630: Check collection id before storing packet to pipeline.
  Every time check_collection_id() is invoked, the caller should ensure
  that this function potentially is rewriting the packet, if it decides
  to insert/update encoded collection ID.

* CCBC-1627: Fix bodylen value when ffextlen (flexible frame extra
  length) is not zero.

3.3.11

Toggle 3.3.11's commit message

Verified

This tag was signed with the committer’s verified signature.
avsej Sergey Avseyev
3.3.11

* CCBC-1618: update query error codes for dynamic authenticator. This is
  an update to internal interface, that allows more granular detection
  of stale authentication conditions for query service.

* Prevent full rebuild on every run of cmake. Do not render built
  timestamp into the header, but instead only use it in object file.

3.3.10

Toggle 3.3.10's commit message

Verified

This tag was signed with the committer’s verified signature.
avsej Sergey Avseyev
3.3.10

* CCBC-1616: apply `wait_for_config` check for all pipelines. Previously, the `lcb_wait` function would wait for the
  pending configuration updates, but don't do it if the configuration update operation is being retried for some reason.
  Now, the operation also will not wait for pending configuration updates, and rather return from `lcb_wait` as soon as
  the operation completes. The old behaviour still works when `wait_for_config=true` is passed in connection string (or
  `LCB_CNTL_WAIT_FOR_CONFIG` set to non-zero value), in this case the library will wait for the configuration. This
  setting does not affect the mode, when the event loop is executed by the application, and without `lcb_wait`.