1# Release Notes
2
3## 3.0.0 (TBD)
4
5* [CCBC-655](https://issues.couchbase.com/browse/CCBC-655): Removed `retry_backoff` setting. This is a redundant
6  property, as the wait period is always `retry_interval * retry_backoff * num_attempts`. In this case, `retry_interval`
7  itself can be specified as `retry_interval * retry_backoff` as a single setting.
8
9  Migration path:
10  * if the application used `"retry_backoff"` setting via connection string or `lcb_cntl_string()`, it should remove
11    that call, and set only `"retry_interval"` with new value equal `retry_interval * retry_backoff` (the value is time
12    in seconds represented as floating point number).
13  * if the application used `LCB_CNTL_RETRY_BACKOFF` setting via `lcb_cntl`, it should remove that call, and set only
14    `LCB_CNTL_RETRY_INTERVAL` with new value equal `retry_interval * retry_backoff` (the value is time in microseconds
15    represented as unsigned 32-bit integer).
16
17* [CCBC-465](https://issues.couchbase.com/browse/CCBC-465): Removed `lcb_error_callback` and related function to get
18  and set it for the instance.
19
20  Migration path: the application should use `lcb_bootstrap_callback` instead.
21
22* [CCBC-466](https://issues.couchbase.com/browse/CCBC-466): Removed `lcb_get_last_error`. This function is deprecated
23  and its use can result in false positives, true negatives. Most internals do not set `last_error`, and because there
24  may be multiple things going on within the library, getting the last error does not make sense.
25
26  Migration path: only arguments/fields in operation and bootstrap callbacks should be used.
27
28* [CCBC-463](https://issues.couchbase.com/browse/CCBC-463): Removed syncmode. This simplifies internals of the library,
29  Synchronous mode was never implemented for REST server APIs, or for new subdocument features, and was deprecated.
30
31  Migration path: use `lcb_wait()` and `lcb_wait3()` to implement synchronous interaction.
32
33* [CCBC-863](https://issues.couchbase.com/browse/CCBC-863): Removed `lcb_configuration_callback` and related functions.
34  This API has been superseded by bootstrap callback, which can not just signal about configuration update, but also
35  provide errors code.
36
37  Migration path: the application should use `lcb_bootstrap_callback` instead.
38
39* [CCBC-467](https://issues.couchbase.com/browse/CCBC-467): Removed `lcb_verify_struct_size` and related definitions.
40   These functions have not been widely used or maintained. Their purpose was to assist applications in verifying the
41   structure sizes used by the library conformed to that of what their application was expecting. However in reality the
42   structure sizes rarely changed, and when they did change, they only changed in compatible ways so that applications
43   compiled against older versions would never break anyway.
44
45   Migration path: If the application directly call this API, all the calls could be safely removed.
46
47* [CCBC-468](https://issues.couchbase.com/browse/CCBC-468): Removed `lcb_timer_t` API. The timer API was never really
48  used and should have always been private (its use came in before we started having 'interface attributes' within the
49  library).
50
51  Migration path: Remove all usages of timer API function and structures. If they are necessary, consider using
52  external IO loop, and use its timers API (see `lcb_create_io_ops()`).
53
54* [CCBC-864](https://issues.couchbase.com/browse/CCBC-864): Removed `lcb_flush_buffers`. This function does nothing.
55
56  Migration path: Remove all usages of this function.
57
58## 2.10.3 (December 20 2018)
59
60* [CCBC-1008](https://issues.couchbase.com/browse/CCBC-1008): jsoncpp: use
61  `unique_ptr` instead of `auto_ptr`.
62
63* [CCBC-1011](https://issues.couchbase.com/browse/CCBC-1011): Port
64  vbucketkeygen tool to cbc-keygen. The tool generates list of keys, that
65  distributed over all vBuckets in the bucket.
66
67* [CCBC-1006](https://issues.couchbase.com/browse/CCBC-1006): Cleanup pending
68  queue of pipeline on retry
69
70* [CCBC-1007](https://issues.couchbase.com/browse/CCBC-1007): allow using
71  trusted store path without key file
72
73* [MB-31875](https://issues.couchbase.com/browse/MB-31875): cliopts: grow list
74  only if needed
75
76## 2.10.2 (November 23 2018)
77
78* Fixed incorrect header-guard for analytics.h, which might affect API
79  visibility (when included before `libcouchbase/n1ql.h`)
80
81## 2.10.1 (November 22 2018)
82
83* [CCBC-997](https://issues.couchbase.com/browse/CCBC-997): Extract analytics
84  queries into separate file, and expose new API as set of `lcb_analytics_*`
85  functions.
86
87* [CCBC-992](https://issues.couchbase.com/browse/CCBC-992): KV ingest mode for
88  analytics. Ingestion mode a way to funnel analytics results back into the KV
89  layer through mutation.
90
91* [CCBC-991](https://issues.couchbase.com/browse/CCBC-991): Analytics Deferred
92  Queries. Deferred queries allow to decouple the execution of an analytics
93  query from actually fetching the results. This is very important for queries
94  that take a long time to complete.
95
96* [CCBC-1004](https://issues.couchbase.com/browse/CCBC-1004): Fix request
97  counting for CAS-observe. Incorrect mapping server indexes during scheduling
98  observe requests might lead to crashes on multi-node clusters.
99
100* [CCBC-1005](https://issues.couchbase.com/browse/CCBC-1005): `select(2)`-based
101  IO plugin: always use expiration when using `lcb_tick_nowait` function to
102  avoid waiting for IO events.
103
104* Updates in testing infrastructure
105
106## 2.10.0 (October 18 2018)
107
108* [CCBC-982](https://issues.couchbase.com/browse/CCBC-982): Support analytics
109  for N1QL service in `lcb_ping3`.
110
111* [CCBC-989](https://issues.couchbase.com/browse/CCBC-989): Write bucket
112  capabilities into config cache, so that the client which was bootstrapped
113  from the cache will be able to reason about features availability (e.g. views).
114
115* [CCBC-987](https://issues.couchbase.com/browse/CCBC-987): Document tracing
116  options for cbc tools.
117
118* [CCBC-988](https://issues.couchbase.com/browse/CCBC-988): Update
119  cbc-pillowfight to work with by-id collections. It still does not use any
120  changes in protocol yet. The collection API will be exposed in 3.0 release.
121
122## 2.9.5 (September 21 2018)
123
124* [CCBC-980](https://issues.couchbase.com/browse/CCBC-980): Make idle timeout
125  for HTTP pool tunable
126
127* [CCBC-977](https://issues.couchbase.com/browse/CCBC-977): Update
128  documentation analytics. Add example demonstrating analytics queries
129
130* [CCBC-968](https://issues.couchbase.com/browse/CCBC-968): Improve log message
131  for `SELECT_BUCKET` on `EACCESS`. Add note saying that this error code might
132  be because of missing bucket.
133
134* [CCBC-976](https://issues.couchbase.com/browse/CCBC-976): Keep HTTP
135  connections pooled after `lcb_ping3`
136
137* [CCBC-975](https://issues.couchbase.com/browse/CCBC-975): Make sure kv
138  service is only enabled if in nodes list.
139
140* [CCBC-972](https://issues.couchbase.com/browse/CCBC-972): Fix memory issues
141  reported by valgrind
142
143* [CCBC-973](https://issues.couchbase.com/browse/CCBC-974): Correctly convert
144  non-null terminated tag buffers to `Json::Value`
145
146## 2.9.4 (August 29 2018)
147
148* [CCBC-970](https://issues.couchbase.com/browse/CCBC-970): Update list of retriable errors for
149  analytics
150
151* [CCBC-965](https://issues.couchbase.com/browse/CCBC-965): Update log level in config cache
152  provider
153
154* [CCBC-967](https://issues.couchbase.com/browse/CCBC-967): optimize Threshold Tracer queues/sorting
155
156* [CCBC-963](https://issues.couchbase.com/browse/CCBC-963): remove global state from random
157  generator, and make it thread-safe.
158
159* [CCBC-966](https://issues.couchbase.com/browse/CCBC-966): return current network for
160  LCB_CNTL_NETWORK
161
162* [CCBC-969](https://issues.couchbase.com/browse/CCBC-969): Allow to skip version from git tags
163
164* [CCBC-961](https://issues.couchbase.com/browse/CCBC-961): Add examples for FTS queries
165
166* [CCBC-971](https://issues.couchbase.com/browse/CCBC-971): disable dead socket detection for older
167  libuv (fixes build on platforms, where old libuv-dev package installed).
168
169* Report HELO features to logger in the single line.
170
171* Allow to select compression mode in connection string. This might be useful for debugging
172  purposes. For example, to bypass inflation step when receiving data.
173
174      $ CONNSTRING=couchbase://localhost/default?compression=deflate_only
175      $ cbc cat -U $CONNSTRING 00000000.json > bindoc.dat
176      00000000.json        CAS=0x15431f831dc60000, Flags=0x0, Size=739, Datatype=0x03(JSON,SNAPPY)
177
178## 2.9.3 (July 18 2018)
179
180* [CCBC-955](https://issues.couchbase.com/browse/CCBC-955): Parse uint32 as
181  unsigned ints instead of timeouts. Some settings were interpreted as time
182  values, while they should not (e.g. console_log_level, compression_min_size
183  etc). This issue forced the library to misinterpret user input (converter was
184  multiplying all values to 1000000, e.g. log level was always TRACE).
185
186* [CCBC-957](https://issues.couchbase.com/browse/CCBC-957): Automatically
187  disable SSL support, when OpenSSL is unavailable.
188
189* [CCBC-954](https://issues.couchbase.com/browse/CCBC-954): Define EFTYPE
190  error code if it does not exist. Fixes support of libuv 1.21 and higher.
191
192* [CCBC-951](https://issues.couchbase.com/browse/CCBC-951): Remove
193  experimental warning from subdoc API.
194
195* [CCBC-948](https://issues.couchbase.com/browse/CCBC-948): Consider retry
196  queue with only 0xb5 as empty. This allows a breakout from lcb_wait earlier
197  (when application operates in synchronous style). The old behavior, where
198  lcb_wait does not breakout until the library gets the first successful
199  configuration, still can be restored with `lcb_cntl(...,
200  LCB_CNTL_WAIT_FOR_CONFIG, ...)`.
201
202* [CCBC-939](https://issues.couchbase.com/browse/CCBC-939): Optimize
203  the performance of built-in tracer. It now uses sllist for tags container
204  instead of Json::Value.
205
206* [CCBC-958](https://issues.couchbase.com/browse/CCBC-958): Check tracing span
207  tags argument more pedantically and return error if arguments are not valid.
208
209* [CCBC-956](https://issues.couchbase.com/browse/CCBC-956): Combine operation
210  id and name into single field in the threshold tracer.
211
212* [CCBC-949](https://issues.couchbase.com/browse/CCBC-949): Do not hardcode
213  libevent dependencies in DEB packages. Instead let `dh_shlibdeps` script to
214  detect dependencies for each platform. This fixes a usless dependency on libevent-1
215  for ubuntu 18.04.
216
217* [CCBC-947](https://issues.couchbase.com/browse/CCBC-947): Fix build scripts
218for examples (when built with `-DLCB_BUILD_EXAMPLES=ON`).
219
220And other small fixes and improvements.
221
222## 2.9.2 (June 22 2018)
223
224* [CCBC-946](https://issues.couchbase.com/browse/CCBC-946): Restore broken ABI in 360ea68ef7738d543bbd3feac3f2c3c6c8ff976b
225
226## 2.9.1 (June 22 2018)
227
228* [CCBC-942](https://issues.couchbase.com/browse/CCBC-942): Expose new error
229  codes for subdocument operations.
230
231* [CCBC-866](https://issues.couchbase.com/browse/CCBC-866): Check cached
232  provider isn't NULL.
233
234* [CCBC-890](https://issues.couchbase.com/browse/CCBC-890): Always check if SSL
235  used when getting ports.
236
237* [CCBC-945](https://issues.couchbase.com/browse/CCBC-945): Allow to specify
238  logger in lcb_create().
239
240* [CCBC-935](https://issues.couchbase.com/browse/CCBC-935): Display orphan
241  tracer report on WARN log level.
242
243* [CCBC-936](https://issues.couchbase.com/browse/CCBC-936): Update default
244  tracing interval to 10 seconds.
245
246* [CCBC-937](https://issues.couchbase.com/browse/CCBC-937): Implement support
247  for alternate addresses.
248
249* [CCBC-943](https://issues.couchbase.com/browse/CCBC-943): Implement option to
250  dump TCP packets.
251
252  This change introduces new cmake option, which will force library to report
253  all incoming/outgoing TCP packets on TRACE log level. It renders the bytes
254  in Base64 encoding.
255
256  Also there is simple extraction tool, which beautifies packet traces, and
257  could be used like this:
258
259      cbc cat  -vvv foo bar 2>&1 | tools/extract-packets.rb
260
261## 2.9.0 (May 24 2018)
262
263This release is mostly about API visibility bump from uncommited to committed,
264but also includes several bug fixes.
265
266* [CCBC-930](https://issues.couchbase.com/browse/CCBC-930): Dump threshold
267  logging tracer queues before destroying the tracer.
268
269* Updates in crypto API as per RFC. This basically change of the API (ABI has
270  preserved compatible, but `v0` crypto API will return runtime error with 2.9.0
271  library. From this release, all encryption key management encapsulated into
272  crypto provider, so it does not need to expose key loader interface. In
273  addition, that user API is changed to conform RFC, and use noun `fields`
274  instead of `document` (e.g. `lcbcrypt_encrypt_fields`).
275
276* [CCBC-925](https://issues.couchbase.com/browse/CCBC-925): Fix existence checks
277  for registered crypto providers.
278
279* [CCBC-924](https://issues.couchbase.com/browse/CCBC-924): Initialize flag for
280  JSON server feature. Otherwise it might be left uninitialized and the library
281  will send JSON datatype to servers, which do not support it.
282
283* [PCBC-543](https://issues.couchbase.com/browse/PCBC-543), [CCBC-932](https://issues.couchbase.com/browse/CCBC-932), [CCBC-933](https://issues.couchbase.com/browse/CCBC-933): Update log levels
284
285## 2.8.7 (May 2 2018)
286
287* [CCBC-917](https://issues.couchbase.com/browse/CCBC-917): Add tracing for
288  observe. So now the library will group all CAS-observe operations, and in
289  general will nest observe operations under common parent when
290  `lcb_storedur3` API used.
291
292* [CCBC-918](https://issues.couchbase.com/browse/CCBC-918): Don't ping KV on
293  nodes without DATA service.
294
295* [CCBC-685](https://issues.couchbase.com/browse/CCBC-685): Implementation of
296  SCRAM-SHA{1,256,512} authentication mechanisms for KV service. Support for
297  SCRAM-SHA* SASL auth is disabled by default, because it is not portable, and
298  not every Couchbase service supports it. But if it is necessary, it could be
299  enabled using `lcb_cntl(..., LCB_CNTL_FORCE_SASL_MECH, ...)` operation, or
300  `"force_sasl_mech=SCRAM-SHA512"` option in connection string.
301
302* [CCBC-919](https://issues.couchbase.com/browse/CCBC-919): More granular
303  settings for compression. Now it is possible to specify minimum size of the
304  value to be considered for compression, and also the minimal ratio
305  `(compressed / original)`. See `LCB_CNTL_COMPRESSION_MIN_SIZE` (or
306  `"compression_min_size=100"` in bytes), and `LCB_CNTL_COMPRESSION_MIN_RATIO`
307  (or `"compression=0.9"`).
308
309* [CCBC-916](https://issues.couchbase.com/browse/CCBC-916): Do not set JSON
310  datatype if server didn't ack it. Fixes behavior where old server rejecting
311  commands as invalid when compression is enabled.
312
313* [CCBC-923](https://issues.couchbase.com/browse/CCBC-923): Allow to disable
314  fast-forward map for NMV handler. See `LCB_CNTL_VB_NOREMAP`
315  (`"vb_noremap=true"`). This option is disabled by default.
316
317Build improvements:
318
319* [CCBC-915](https://issues.couchbase.com/browse/CCBC-915): Fix builds
320  where DEBUG macro is defined
321
322* [CBD-2405](https://issues.couchbase.com/browse/CBD-2405): Change
323  target names in conflict with Server targets
324
325## 2.8.6 (April 5 2018)
326
327* [CCBC-888](https://issues.couchbase.com/browse/CCBC-888): Add threshold
328  logging tracer, which tracks and reports above threshold and orphaned operations.
329  This is beta functionality, which is disabled by default. To enable it, use
330  `enable_tracing=on` in the connection string.
331
332* [CCBC-910](https://issues.couchbase.com/browse/CCBC-910): Field encryption
333  API. The `lcbcrypto_*` functions abstracts encrypted field layout from actual
334  crypto implementations (OpenSSL, libsodium, etc.). The wrapper or application
335  using libcouchbase is expected to connect their own crypto and key providers, while
336  libcouchbase provides transformation of the encrypted data. See
337  sample crypto provider in [example/crypto](example/crypto).
338
339* [CCBC-904](https://issues.couchbase.com/browse/CCBC-904): Remove trailing
340  comma in `lcb_KVBUFTYPE` enum. Fixes build on some older
341  compilers.
342
343* [CCBC-907](https://issues.couchbase.com/browse/CCBC-907): cbc-n1qlback: Do
344  not require trailing empty line for input.
345
346* [CCBC-908](https://issues.couchbase.com/browse/CCBC-908): cbc-n1qlback:
347  Report number of loaded queries.
348
349* Add ability to write OPS/SEC from cbc-pillowfight to a file
350
351      cbc-pillowfight 2> /tmp/stats.txt
352
353  or, when writing to terminal required
354
355      cbc-pillowfight 2>&1 | tee /tmp/stats.txt
356
357* Build improvements for easier integration into with server manifest (and TLM project).
358
359## 2.8.5 (February 23 2018)
360
361* [CCBC-883](https://issues.couchbase.com/browse/CCBC-883): Always use built-in compression.
362  It is not possible to unbundle the Snappy library, as libcouchbase uses the C++ API which is not
363  exported in the headers. Also, compression can now work on all types of buffers, including
364  `LCB_KV_IOV` and `LCB_KV_IOVCOPY`. This fixes compression in `cbc-pillowfight` tool.
365
366* [CCBC-895](https://issues.couchbase.com/browse/CCBC-895): Fix typo in rendering IPv6 addresses
367  in `lcb_diag`.
368
369* [CCBC-879](https://issues.couchbase.com/browse/CCBC-879): Implement log redaction. When
370  `log_redaction=on` is specified in the connection string, the library will wrap sensitive
371  data in the logs in special tags, which can be processed by the
372  `cblogredaction` tool from the server distribution.
373
374* [CCBC-893](https://issues.couchbase.com/browse/CCBC-894): Updated list of subdoc error codes.
375
376* [CCBC-892](https://issues.couchbase.com/browse/CCBC-892): Enable the SSL trust store to be in
377  a separate file. Trust store has to be specified with option `truststorepath=…`, otherwise
378  the library will expect it to be stored with the certificate in `certpath=`.
379
380* [CCBC-888](https://issues.couchbase.com/browse/CCBC-888): Per operation tracing. When
381  compiled with tracing support (`cmake -DLCB_TRACING=ON`), the library will expose the tracing
382  API, which allows to measure time of every data operation, and include some extra information.
383  The API is modeled after OpenTracing and allows one to write custom tracers to consume this
384  information. For more information, see an example in
385  [example/tracing/tracing.c](example/tracing/tracing.c).  This is uncommitted API at this time.
386
387  Also this feature includes support for new type of the server responses, which include
388  time spent to execute the KV command on the server. This feature controlled by `enable_tracing`
389  option in connection string or `lcb_cntl(..., LCB_CNTL_ENABLE_TRACING, ...)`.
390
391* Added basic support of JSON datatype. The library will negotiate a mode, in which the
392  application will see `LCB_VALUE_F_JSON` flag on datatype field of the response in the
393  operation callback, if the cluster  detected the content of the document to be valid JSON.
394  Also the application can send this flag on the outgoing documents to notify the server
395  about payload format.
396
397* Refresh dtrace/systemtap integration. Also adds tapset for SystemTap to simplify access to
398  trace points.
399
400* cbc-pillowfight improvements and changes:
401  * dump diagnostics on `SIGQUIT` (CTRL-\ in terminal).
402  * with `-J`/`--json`, the JSON datatype will be sent on the documents.
403  * enable randomized document bodies with `-R`/`--random-body` switch.
404  * durability checks for pillowfight with `--persist-to`/`--replicate-to`.
405  * pessimistic locking of keys before updating with `--lock`.
406  * when requesting timings with `-T`/`--timings`, the application will no longer dump them
407    periodically.Instead it will await for the user to signal `SIGQUIT` and also dump
408    them on exit. The old mode of reporting regularly is enabled by repeating the switch more than
409    once (e.g. `-TT`).
410
411* Added the cbc-watch command to monitor server stats. By default it tracks `cmd_total_ops`,
412  `cmd_total_gets` and `cmd_total_sets` updating stats once a second, and displaying
413  diff with the previous value.
414
415
416## 2.8.4 (December 20 2017)
417
418* [CCBC-880](https://issues.couchbase.com/browse/CCBC-880): Implement x.509 client
419  certificate authentication. Connection string must use TLS-enabled scheme
420  (`couchbases://` or `https://`) and set options `certpath` and `keypath`. For example,
421
422        couchbases://127.0.0.1?certpath=/path/to/chain.pem&keypath=/path/to/client.key
423
424  Read more at server docs: https://developer.couchbase.com/documentation/server/5.0/security/security-x509certsintro.html
425
426* [CCBC-883](https://issues.couchbase.com/browse/CCBC-883): Revisit builtin compression
427  implementation (snappy). Add compression to cbc tools (see `--compress`, `-y` options).
428  Future versions of Couchbase Server will have end-to-end compression.
429
430* [CCBC-885](https://issues.couchbase.com/browse/CCBC-885): Do not skip HTTP Basic
431  authentication when password is empty.
432
433* [CCBC-876](https://issues.couchbase.com/browse/CCBC-876): Make sure that server
434  authority is always specified.  In some cases, when libcouchbase generates vbucket
435  configuration or data service is not available, the authority of the server might be
436  NULL.  This could cause issues, as we compare servers from configs using their authority
437  fields.
438
439* [CCBC-878](https://issues.couchbase.com/browse/CCBC-878): Support collections in
440  cbc-pillowfight.
441
442  Note that this change does not expose anything related to Collections API for
443  libcouchbase. It defines hidden switches for pillowfight tool to allow benchmark of
444  collections. The switches are not documented and might be removed in the future. Use
445  with care.
446
447  Generate only `beer:<seqno>` keys:
448
449        cbc pillowfight --separator : --collection beer
450
451  Using many --collection will alternate in generating `beer:<seqno>`, `brewery:<seqno>`
452  keys (default separator is ":"):
453
454        cbc pillowfight --collection beer --collection brewery
455
456* [CCBC-801](https://issues.couchbase.com/browse/CCBC-801): Expose information about
457  network IO for monitoring. The diagnostics exposed as string with encoded JSON object.
458
459        void diag_callback(lcb_t instance, int cbtype, const lcb_RESPBASE *rb)
460        {
461            const lcb_RESPDIAG *resp = (const lcb_RESPDIAG *)rb;
462            if (resp->rc != LCB_SUCCESS) {
463                fprintf(stderr, "failed: %s ", lcb_strerror(NULL, resp->rc));
464            } else {
465                if (resp->njson) {
466                    fprintf(stderr, "%.*s", (int)resp->njson, resp->json);
467                }
468            }
469        }
470
471        lcb_install_callback3(instance, LCB_CALLBACK_DIAG, diag_callback);
472        lcb_CMDDIAG cmd = { 0 };
473        lcb_diag(instance, NULL, &cmd);
474        lcb_wait(instance);
475
476* [CCBC-874](https://issues.couchbase.com/browse/CCBC-874): Dynamic authenticator. Note
477  that this feature should not be considered at public interface. To use it, application
478  have to define two callbacks, which will return username and password dependending on
479  bucket name and hostname/port of the endpoint.
480
481        std::map< std::string, std::string > credentials = {
482            {"protected", "secret"}
483        };
484        extern "C" {
485          static const char *get_username(void *cookie,
486                                          const char *host,
487                                          const char *port,
488                                          const char *bucket)
489          {
490              return bucket;
491          }
492
493          static const char *get_password(void *cookie,
494                                          const char *host,
495                                          const char *port,
496                                          const char *bucket)
497          {
498              std::map< std::string, std::string > *credentials =
499                  static_cast<std::map< std::string, std::string > *>(cookie);
500              return (*credentials)[bucket].c_str();
501          }
502        }
503
504
505   and later pass these callbacks to authenticator like this:
506
507
508        lcb_AUTHENTICATOR *auth = lcbauth_new();
509        lcbauth_set_callbacks(auth, &credentials, get_username, get_password);
510        lcbauth_set_mode(auth, LCBAUTH_MODE_DYNAMIC);
511        lcb_set_auth(instance, auth);
512
513* Include platform/compiler into client id, which included into HELLO and HTTP requests.
514
515* Fix parallel build on Linux when dtrace enabled
516
517* cbc-proxy: proxy N1QL, FTS and Analytics queries using STAT command.
518
519## 2.8.3 (November 21 2017)
520
521* [CCBC-415](https://issues.couchbase.com/browse/CCBC-415): Fixes in IPv6 support.
522  To use IPv6 addresses, the application should connect to IPv6-enabled Couchbase Server,
523  and explicitly switch on option via connection string `ipv6=allow` or `ipv6=only`,
524  where first variant permits the library to use both IPv6 and IPv4, and the second --
525  disables IPv4. Alternatively this setting controlled with `LCB_CNTL_IP6POLICY` and
526  `lcb_cntl`.
527
528* [CCBC-872](https://issues.couchbase.com/browse/CCBC-872): Metrics management
529  These metrics are intended at providing information on libcouchbase operations performed
530  over the lifetime of the current `lcb_t` instance (processed request packets, processed
531  response packets, request packets pending emission, server errors, server timeouts,
532  misrouted operations, retried operations).
533
534  Metrics collection is currently disabled by default. To enable metrics collection,
535  the user should call:
536
537        int activate = 1;
538        lcb_cntl(instance, LCB_CNTL_SET, LCB_CNTL_METRICS, &activate);
539
540  Access to the collected metrics is done using:
541
542        lcb_METRICS* my_metrics;
543        lcb_cntl(instance, LCB_CNTL_GET, LCB_CNTL_METRICS, &my_metrics);
544
545* [CCBC-870](https://issues.couchbase.com/browse/CCBC-870): Fix updating URL on retry. When retrying HTTP request, instead of replacing just `host:port` part of the old URL, the library inserted full URL.
546
547* [CCBC-547](https://issues.couchbase.com/browse/CCBC-547): Detect dead sockets under libuv.
548
549* Ensure macros safe by surrounding values with parentheses
550
551## 2.8.2 (October 17 2017)
552
553* [CCBC-833](https://issues.couchbase.com/browse/CCBC-833), [CCBC-834](https://issues.couchbase.com/browse/CCBC-834):
554  Update real cluster integration in the test suite.
555
556* [CCBC-860](https://issues.couchbase.com/browse/CCBC-860): cbc-connstr: Do not zero out C++ instances.
557
558* [CCBC-859](https://issues.couchbase.com/browse/CCBC-859): Fix libm shared object detection on Debian 9.
559
560* Bugs reported by [clang analyzer](http://clang-analyzer.llvm.org/):
561
562  * [CCBC-858](https://issues.couchbase.com/browse/CCBC-858): Fix memory leak for compressed packet.
563  * [CCBC-857](https://issues.couchbase.com/browse/CCBC-857): Fix possible NULL pointer dereference in `mcreq_reserve_key`.
564  * [CCBC-856](https://issues.couchbase.com/browse/CCBC-856): Initialize response struct in `H_config`.
565  * [CCBC-855](https://issues.couchbase.com/browse/CCBC-855): Fix dead assignments in `contrib/genhash`.
566  * [CCBC-854](https://issues.couchbase.com/browse/CCBC-854): Init vbguess array before entry lookup.
567  * [CCBC-853](https://issues.couchbase.com/browse/CCBC-853): cbc-proxy: do not use client object after free.
568  * [CCBC-852](https://issues.couchbase.com/browse/CCBC-852): Do not free memory twice in N1QL index manager.
569
570## 2.8.1 (September 20 2017)
571
572* Check nodes number for durability checks. The store with durability
573  requirements will report more specific error when the library cannot
574  fulfill the condition during failover.
575  * Issues: [CCBC-817](https://issues.couchbase.com/browse/CCBC-817)
576
577* Handle enhanced error messages for subdoc operations. The subdoc
578  responses will now expose context and reference ID if present.
579  * Issues: [CCBC-846](https://issues.couchbase.com/browse/CCBC-846)
580
581* Discover and bootstrap analytics service from cluster configuration.
582  * Issues: [CCBC-840](https://issues.couchbase.com/browse/CCBC-840)
583
584* Improve documentation of configuration parameters.
585  * Issues: [CCBC-835](https://issues.couchbase.com/browse/CCBC-835)
586
587* Enable Error Map feature by default.
588  * Issues: [CCBC-838](https://issues.couchbase.com/browse/CCBC-838)
589
590* Cleanup and extend `minimal`, `libeventdirect`, `instancepool` examples
591
592* Tools:
593  * improve error reporting
594  * experimental subcommand `cbc-proxy`
595  * fix memory leaks
596  * retry store operations during population phase in `cbc-pillowfight`
597
598## 2.8.0 (August 31 2017)
599
600* Add support for OpenSSL-1.1.
601  * Issues: [CCBC-814](https://issues.couchbase.com/browse/CCBC-814)
602
603* Mask `LOCKED` status code for backward compatibility. This code
604  (as well as others possible codes with 'item-locked' attribute)
605  replaced with `LCB_KEY_EEXISTS` for `SET`, `REPLACE` and `DELETE`
606  operations, and with `LCB_ETMPFAIL` for the rest.
607  * Issues: [CCBC-832](https://issues.couchbase.com/browse/CCBC-832)
608
609* Stop enumerating bootstrap nodes and mechanisms when the server
610  returns authentication error.
611  * Issues: [CCBC-825](https://issues.couchbase.com/browse/CCBC-825)
612
613* Fixed double free error with `lcb_ping3`.
614  * Issues: [CCBC-826](https://issues.couchbase.com/browse/CCBC-826)
615
616* Exposed additional N1QL query parameters: `lcb_n1p_readonly`,
617  `lcb_n1p_scancap`, `lcb_n1p_pipelinecap`.
618  * Issues: [CCBC-823](https://issues.couchbase.com/browse/CCBC-823)
619
620* Fixed `cbc-subdoc/upsert` without XATTR.
621  * Issues: [CCBC-823](https://issues.couchbase.com/browse/CCBC-823)
622
623* XERROR attributes synchronized with recent list on server.
624  * Issues: [CCBC-828](https://issues.couchbase.com/browse/CCBC-828)
625
626* Add missing documentation, and update stability of the API.
627  * Issues:
628  [CCBC-830](https://issues.couchbase.com/browse/CCBC-830),
629  [CCBC-831](https://issues.couchbase.com/browse/CCBC-831),
630  [CCBC-827](https://issues.couchbase.com/browse/CCBC-827)
631
632* Do not throttle background configuration polling by throttle interval
633  of configuration error handler.
634  * Issues: [CCBC-829](https://issues.couchbase.com/browse/CCBC-829)
635
636* Turn on background polling by default. The library will try
637  to schedule configuration update every 2.5 seconds. To disable it
638  use `config_poll_interval=0`.
639  * Issues: [CCBC-836](https://issues.couchbase.com/browse/CCBC-836)
640
641## 2.7.7 (August 17 2017)
642
643* Implement new function `lcb_ping3`, which sends NOOP-like message to
644  each service in the cluster and allows to measure latency along with
645  health status of the connection. Might be useful for application-side
646  keep-alive mechanisms.
647  * Issues: [CCBC-801](https://issues.couchbase.com/browse/CCBC-801)
648
649* Detect and expose bucket type through `LCB_CNTL_BUCKETTYPE`:
650
651        lcb_BTYPE type;
652        lcb_cntl(instance, LCB_CNTL_GET, LCB_CNTL_BUCKETTYPE, &type);
653
654  * Issues: [CCBC-790](https://issues.couchbase.com/browse/CCBC-790)
655
656* Fixed setting expiration in subdoc mutations.
657  * Issues: [CCBC-799](https://issues.couchbase.com/browse/CCBC-816)
658
659* Fixed DNS SRV support of Fedora 26 and FreeBSD.
660  * Issues: [CCBC-816](https://issues.couchbase.com/browse/CCBC-816)
661
662* Fixed DNS SRV with SSL connections.
663  * Issues: [CCBC-794](https://issues.couchbase.com/browse/CCBC-794)
664
665* Define EREMOTEIO in libuv
666  * Issues: [CCBC-812](https://issues.couchbase.com/browse/CCBC-812)
667
668* New subdocument command to remove whole document
669  * Issues: [CCBC-811](https://issues.couchbase.com/browse/CCBC-811)
670
671* New cbc command: `cbc-subdoc`. It provides interactive shell, where
672  all subdocument commands accessible to inspect and modify documents
673  in the cluster.
674
675* New cbc command: `cbc-ping`. It sends NOOP-like messages to all accessible
676  services in the cluster, and displays the status along with latency.
677  * Issues: [CCBC-801](https://issues.couchbase.com/browse/CCBC-801)
678
679* Fix `cbc-cat --replica`, which now allows reading documents from replicas.
680  * Issues: [CCBC-820](https://issues.couchbase.com/browse/CCBC-820)
681
682* Implement NOOP command and `cbc-pillowfight --noop`, which sends NOOP
683  instead of data manipulation commands.
684  * Issues: [CCBC-801](https://issues.couchbase.com/browse/CCBC-801)
685
686* Clarify errors found in `.cbcrc`. Now it will display configuration path
687  along with error message.
688  * Issues: [CCBC-759](https://issues.couchbase.com/browse/CCBC-759]
689
690* Update examples:
691  * Support username/password in subdoc and libeventdirect examples
692  * Added example for subdoc XATTRs
693
694* Integrate fix for parallel build with dtrace on FreeBSD
695  https://github.com/freebsd/freebsd-ports/commit/a71e1a86b851d42cd08319d9b28a4424e508e216
696
697* Make enhanced errors API public
698  * Issues: [CCBC-803](https://issues.couchbase.com/browse/CCBC-803)
699
700* Fixed various compiler and cppcheck warnings and documentation update.
701
702## 2.7.6 (July 11 2017)
703
704* Expose enhanced errors for data commands. Couchbase Server 5 might return
705  additional information about errors in the response body. According to
706  SDK-RFC-28, the library allow user code to inspect this information using
707  following functions:
708
709    * `lcb_resp_get_error_context(int, const lcb_RESPBASE *)`
710    * `lcb_resp_get_error_ref(int, const lcb_RESPBASE *)`
711
712  They both return non-NULL strings if any of error information accessible.
713  The lifetime of these fields limited by lifetime of the response object.
714  * Issues: [CCBC-781](https://issues.couchbase.com/browse/CCBC-781)
715
716* Report contextualized error messages during negotiation. The event reference
717  could be used to find more details about authentication errors in the server
718  logs.
719  * Issues: [CCBC-780](https://issues.couchbase.com/browse/CCBC-780)
720
721* Specify correct protocol level for `SO_KEEPALIVE`. This fixes setting
722  `tcp_keepalive` option on connections.
723  * Issues: [CCBC-798](https://issues.couchbase.com/browse/CCBC-798)
724
725* Implement Error Map Retries. This implements the mechanics needed to retry
726  commands on various errors based on dynamic settings supplied via the error map.
727  * Issues: [CCBC-783](https://issues.couchbase.com/browse/CCBC-783)
728
729* Add cluster admin provider. This provider doesn't do anything except serve
730  as a source of management hostnames. And the library will fall back to it
731  when bucket is not specified for cluster management connections.
732  * Issues: [CCBC-797](https://issues.couchbase.com/browse/CCBC-797)
733
734* Implement RBAC user management in cbc tools. In addition to `examples/users`,
735  this can be a demonstration of new security APIs which appear in Couchbase
736  Server 5.
737  * Issues: [CCBC-757](https://issues.couchbase.com/browse/CCBC-757)
738
739* Allow to inspect query errors in `cbc-n1qlback`. The command will write
740  details for failed queries to file, specified with option `--error-log`.
741
742* Fix memory leak in io::Pool
743  * Issues: [CCBC-791](https://issues.couchbase.com/browse/CCBC-791)
744
745* Fix `LCB_SDCMD_GET_FULLDOC`. This would not actually work beforehand
746  because the opcode it's mapped to is 0, and we used 0 as a sentinel
747  value for an invalid opcode within the subdoc implementation.
748  * Issues: [CCBC-792](https://issues.couchbase.com/browse/CCBC-792)
749
750* Add LCB_NOT_AUTHORIZED error code. This error code maps to
751  Memcached's EACCESS
752
753* Don't send empty Authorization header for HTTP requests, If there's
754  no username and/or password
755  * Issues: [CCBC-789](https://issues.couchbase.com/browse/CCBC-789)
756
757* Internal refactoring:
758  - `io::Pool` - remove empty dtor
759  - Fix `BadPluginEnvironment` test on Fedora where libm.so is ld script
760  - Add missing commands for `cbc-help`
761
762* Documentation update:
763  - Add additional documentation for `lcb_n1ql_cancel()`
764  - Typos
765
766## 2.7.5 (May 17 2017)
767
768* Allow to disable sending the `HELLO` command when connecting to a server.
769  Sending `HELLO` will cause a bootstrap failure with Couchbase Server 2.0 and
770  older.
771  * Issues: [CCBC-786](https://issues.couchbase.com/browse/CCBC-786)
772
773* Fix error return value on reprepared query.
774  Previously an error was returned if a N1QL query was reprepared, because
775  the prior internal failure status was not updated.
776  * Issues: [CCBC-782](https://issues.couchbase.com/browse/CCBC-782)
777
778* Check for more N1QL error strings indicating the need to reprepare a statement.
779
780* Fix uninitialized memory issue when initializing `lcb::Server` and `mc_PIPELINE`
781
782* Couchbase 5.0 additions for Subdocument.
783  This adds new protocol extensions for Couchbase 5.0. This consists of:
784  * New `LCB_SDCMD_SET_FULLDOC` and `LCB_SDCMD_GET_FULLDOC` for full-doucument
785    gets and sets via the subdoc API. This allows to access xattrs atomically
786    with the document body.
787  * New 'document flags'. These are in the form of `LCB_CMDSUBDOC_F_`.
788  * Issues: [CCBC-774](https://issues.couchbase.com/browse/CCBC-774)
789
790* Fix bug where CCCP subsystem would be suspended indefinitely.
791  CCCP subsystem would hang if an error was received for the config request
792  itself.
793  * Issues: [CCBC-779](https://issues.couchbase.com/browse/CCBC-779)
794
795* Fix bootstrap with `LCB_TYPE_CLUSTER`. Previously bootstrap would fail because
796  the client would not send proper credentials. Note that at this point, the
797  `default` bucket must still exist.
798  * Issues: [CCBC-778](https://issues.couchbase.com/browse/CCBC-778)
799
800* Ignore empty DNS SRV replies.
801  Some buggy DNS configurations return positive replies to SRV queries, but
802  without actually containing any kind of A record as a response.
803  * Issues: [CCBC-776](https://issues.couchbase.com/browse/CCBC-776)
804
805* Enable background polling for configuration changes.
806  This allows the client to periodically poll for configuration changes. This
807  feature is disabled by default. You can use the `config_poll_interval`
808  setting to enable it in the connection string.
809  * Issues: [CCBC-627](https://issues.couchbase.com/browse/CCBC-627)
810
811* Enable TCP Keepalive for newly created sockets.
812  Newly created sockets have TCP keepalive enabled in order to avoid firewalls
813  breaking connections due to inactivity. TCP Keepalive does not yet work for
814  the libuv plugin (e.g. nodejs).
815  You can use the `tcp_keepalive=false` directive in the connection string
816  to disable it.
817  * Issues: [CCBC-690](https://issues.couchbase.com/browse/CCBC-690)
818
819## 2.7.4 (April 18 2017)
820
821* Send `SELECT_BUCKET` command by default if server supports it. This enables
822  new-style 'RBAC' authentication by default. In 2.7.3 users were required to
823  use `select_bucket=true` in the connection string to enable this feature.
824  In this version, the option is still available but is now mainly useful to
825  disable it.
826
827* Improve `lcb_AUTHENTICATOR` API. This provides better documentation and some
828  API/design/implementation fixes to the authenticator interface. The
829  authenticator may be useful for integrators/wrappers who wish to correlate
830  multiple credentials with their buckets.
831  Note that the use of `lcb_AUTHENTICATOR` is *not* required for RBAC support.
832  In order to use RBAC, simply make use of the `username` field in
833  the `lcb_create_st` struct, or the `username` parameter in the connection
834  string.
835  * Issues: [CCBC-751](https://issues.couchbase.com/browse/CCBC-751)
836
837* Fix bug where `lcb_get_server_list()` would return NULL.
838  * Issues: [CCBC-764](https://issues.couchbase.com/browse/CCBC-764)
839
840* Fix bug where client would not recover from failover. Clients from version
841  2.7.1 through 2.7.3 would not obtain a new cluster map after a node had
842  been failed over (e.g. by hitting the "fail over" button in the UI).
843  * Issues: [CCBC-761](https://issues.couchbase.com/browse/CCBC-761)
844
845## 2.7.3 (March 21 2017)
846
847* Provide the ability to send the `SELECT_BUCKET` when establishing a
848  to a server. This is a building block allowing us to use 'RBAC'/username
849  auth in the future.
850  Note that this requires the `select_bucket=true` option in the connection
851  string or equivalent, and that this feature as a whole is considered
852  experimental.
853  * Priority: Major
854  * Issues: [CCBC-758](https://issues.couchbase.com/browse/CCBC-758)
855
856* Provide an option to disable DNS-SRV lookups. Because DNS SRV lookups often
857  result in no result (i.e. `NXDOMAIN`) - which takes longer, allowing to
858  disable such lookups may speed up startup time.
859  This option is available via the connection string, using `dnssrv=off`
860  * Priority: Minor
861  * Issues: [CCBC-756](https://issues.couchbase.com/browse/CCBC-756)
862
863* Send client/user-specific identifier in `User-Agent` HTTP header.
864  The library already does this for data nodes (Memcached). Using it in HTTP
865  services allows better supportability when diagnosing issues by reading the
866  HTTP logs.
867  * Priority: Major
868  * Issues: [CCBC-755](https://issues.couchbase.com/browse/CCBC-755)
869
870* Fix bug where DNS SRV hostnames would not be used.
871  While DNS SRV lookup was working, the library would not actually attempt
872  bootstrap off those received hostnames.
873  * Priority: Major
874  * Issues: [CCBC-753](https://issues.couchbase.com/browse/CCBC-753)
875
876* Provide experimental Analytics support.
877  This allows access to the Couchbase Analytics Service, available in
878  some pre-release builds. API and syntax wise, Analytics is very similar
879  to N1QL.
880  To use the analytics service, set the `LCB_CMDN1QL_F_CBASQUERY` bit in
881  `lcb_CMDN1QL::cmdflags`, and provide the appropriate _host:port_ combination
882  in the `lcb_CMDN1QL::host` field. - Currently, analytics support is not
883  used in the cluster map/configuration.
884  * Priority: Major
885  * Issues: [CCBC-734](https://issues.couchbase.com/browse/CCBC-734)
886
887## 2.7.2 (February 21 2017)
888
889This release consists of additional internal refactoring and some improved
890logging messages. There is enhanced experimental XATTR support. This release
891also contains some bug fixes:
892
893* Fix build issues on FreeBSD. This allows normal BSD `make` to be used, rather
894  than forcing `gmake`
895
896* Fixed broken JIRA link in README
897
898* Fix hanging SSL connections in IOCP/Completion mode. This would sometimes
899  stall the connection by not requesting a write if a read was in progress.
900  This would result in the command not being sent and the client hanging.
901  Note that this only affects completion-style I/O plugins such as IOCP and
902  libuv.
903  * Issues: [CCBC-744](https://issues.couchbase.com/browse/CCBC-744)
904
905* Rename `LCB_SDSPEC_F_VIRTPATH` to `LCB_SDSPEC_F_MACROVALUES`. `VIRTPATH`
906  is intended for possible future materialized XATTRs.
907
908* Add `LCB_SDSPEC_F_XATTR_DELETED_OK`, which maps to the protocol flag of
909  roughly the same name.
910
911## 2.7.1 (January 19 2017)
912
913This release consists of additional internal refactoring. More internals have
914been converted to C++.
915
916* Provide XATTR (Extended Attribute) prototype support.
917  This provides a prototype implementation of xattrs, allowing the client to
918  access extended (hidden) attributes of a document. This feature can be used
919  on the client side by simply setting the `LCB_SDSPEC_F_XATTRPATH` bit in
920  the `lcb_SDSPEC::options` field.
921  * Issues: [CCBC-728](https://issues.couchbase.com/browse/CCBC-728)
922
923* Add automatic DNS SRV record lookup when simple hostname supplied.
924  The library will now automatically attempt to look up SRV records
925  for various couchbase services if only one host is present in the
926  connection string. Automatic lookup will not be performed if more
927  than a single host is provded. See the [Java Documentation](https://developer.couchbase.com/documentation/server/current/sdk/java/managing-connections.html)
928  on the matter (go to the bottom of the page).
929  * Issues: [CCBC-566](https://issues.couchbase.com/browse/CCBC-566)
930
931## 2.7.0 (December 21 2016)
932
933This release consists mainly of internal refactoring. Many of the internals
934have been 'upgraded' to C++
935
936## 2.6.4 (November 28 2016)
937
938* Fix bug in pillowfight where large value sizes would cause a segfault.
939  * Issues: [CCBC-727](https://issues.couchbase.com/browse/CCBC-727)
940
941* Allow 64 bit values with `cbc-incr` and `cbc-decr`.
942  * Issues: [CCBC-716](https://issues.couchbase.com/browse/CCBC-716)
943
944* Fix encoding in `lcb_n1p_setconsistent_token`. This function would encode
945  it as `scan_vector` but it should be `scan_vectors`.
946
947* Refactor negotiation internals to use C++.
948  This is part of an internal refactoring to move our internals over to C++.
949  This will make the code more manageable and extendable in the future.
950
951## 2.6.3 (September 27 2016)
952
953* Fix memory corruption for some JSON APIs when no rows are returned.
954  This fixes a bug where the JSON parser would read from garbage memory when
955  parsing a response that had no rows, but due to a slow network, would be
956  received in multiple chunks.
957  This affects N1QL, CBFT, and View APIs.
958  * Priority: Major
959  * Issues: [CCBC-721](https://issues.couchbase.com/browse/CCBC-721)
960
961* Allow to adjust bytes to read per event loop iteration.
962  This allows applications with high network throughput but low CPU capacity
963  to prevent the library from oversaturating a specific event callback invocation
964  or starve other sockets. It may be controlled through the `read_chunk_size`
965  connection string option or via `lcb_cntl_string`.
966  * Priority: Major
967  * Issues: [CCBC-568](https://issues.couchbase.com/browse/CCBC-568)
968
969* Use `htonll` for CAS values.
970  This allows a consistent representation of CAS values regardless of underlying
971  platform. This allows interoperability between other SDKs with respect to
972  exchanging CAS values. This however may break interoperability with older
973  versions of the same SDK, if the CAS value is being passed around (which it
974  shouldn't be).
975
976* New subdocument additions.
977  This adds the `LCB_SUBDOC_F_MKDOCUMENT` flag which allows document creation
978  if the document does not exist, and can be used for mutation operations which
979  may create new paths or values. The `LCB_SUBDOC_CMD_GET_COUNT` is also added,
980  which is a new command which retrieves the number of elements (for an array)
981  or key-value items (within an object/dictionary) of a given path.
982  Both these features require Couchbase Server 4.6 (or its prereleases).
983  * Priority: Major
984  * Issues: [CCBC-718](https://issues.couchbase.com/browse/CCBC-718)
985
986## 2.6.2 (July 26 2016)
987
988* Don't crash on high number of FDs with select plugin. Because `select(2)`
989  can only accomodate up to a certain number of file descriptors in the
990  application, if opening a socket results in a too-high-numbered FD, the
991  plugin will return an error rather than silently failing during polling.
992  * Priority: Major
993  * Issues: [CCBC-567](https://issues.couchbase.com/browse/CCBC-567)
994
995* Pillowfight can now set ttl (expiry). This is done via the `-e` or `--expiry`
996  option.
997  * Priority: Major
998  * Issues: [CCBC-637](https://issues.couchbase.com/browse/CCBC-637)
999
1000* Log URLs of HTTP requests. This may make it easier to debug some HTTP-based
1001  APIs. The URLs are printed as part of the `TRACE` logging level.
1002  * Priority: Major
1003  * Issues: [CCBC-641](https://issues.couchbase.com/browse/CCBC-641)
1004
1005* Fix crash on shutdown with completion-based I/O. The crash was a result
1006  of dereferencing the `lcb_t` after it had been destroyed. This bug affected
1007  completion-based I/O subsystems such as libuv and IOCP.
1008  * Priority: Major
1009  * Issues: [CCBC-707](https://issues.couchbase.com/browse/CCBC-707)
1010
1011* Do not require `operation` field to be set on `lcb_CMDSTORE`.
1012  Starting from this version, a new `lcb_storage_t` constant, `LCB_UPSERT`
1013  has been added with a value of 0. This means that upsert operations no
1014  longer need to explicitly use `LCB_SET`, it being the default.
1015  * Priority: Major
1016  * Issues: [CCBC-545](https://issues.couchbase.com/browse/CCBC-545)
1017
1018## 2.6.1 (June 21 2016)
1019
1020* Index management API now properly handles 'fields' field. Previously this
1021  was treated as a csv string, when it is in fact a JSON array.
1022
1023* `pillowfight` now has a `--populate-only` option, which is useful when simply
1024  trying to populate buckets with large amounts of data.
1025
1026* Allow to bypass OpenSSL initialization. This allows applications which already
1027  have OpenSSL intialization code in place to suppress libcouchbase's own
1028  OpenSSL initialization code. You can disable SSL initialization by using
1029  `ssl=no_global_init` in the connection string.
1030
1031* Allow to toggle sending of multiple credentials in N1QL queries.
1032  You can use the `LCB_CMD_F_MULTIAUTH` in the `lcb_CMDN1QL::cmdflags` field
1033  to indicate that multiple credentials should be added. Otherwise only the
1034  current bucket's credentials will be sent.
1035
1036* Fix infinite loop on completion (UV,nodejs,IOCP) type IO plugins.
1037  This bug would be triggered when only a single server remained in the cluster
1038  and that single server failed. This would result in the client never being
1039  able to perform operations due to a delayed reference count decrement.
1040  * Priority: Major
1041  * Issues: [CCBC-704](https://issues.couchbase.com/browse/CCBC-704)
1042
1043## 2.6.0 (May 17 2016)
1044
1045* Improve index management API and implementation. The `rawjson` field was
1046  being ignored and the `condition` field was missing as well.
1047
1048* Add pillowfight support for subdoc. At the simplest level you can simply
1049  invoke pillowfight as `cbc-pillowfight --subdoc --json <other args>`.
1050  Refer to the pillowfight documentation for more details.
1051
1052## 2.5.8 (April 19 2016)
1053
1054* Fix SSL connectivity errors with views and HTTP bootstrapping.
1055  This would cause network connectivity issues when attempting to bootstrap
1056  via `https://` or using views (`lcb_view_query()`). The fix is a workaround
1057  to not advertise older SSL encryption methods.
1058  * Priority: Major
1059  * Issues: [CCBC-688](https://issues.couchbase.com/browse/CCBC-688)
1060
1061* Do not abort when receiving a memcached EINVAL response.
1062  While the client should never end up in a situation where it receives an
1063  `EINVAL` from the server, it should nevertheless not terminate the execution
1064  of the current process. This bug was introduced in 2.5.6
1065  * Issues: [CCBC-689](https://issues.couchbase.com/browse/CCBC-689)
1066
1067* Fix memory leak when using N1QL prepared statements.
1068  Prepared statements would never be freed, even when the client handle was
1069  destroyed (`lcb_destroy()`) causing a slight memory leak.
1070
1071* Append CRLF header after host header.
1072  This would sometimes result in odd HTTP headers being sent out.
1073  * Issues: [CCBC-694](https://issues.couchbase.com/browse/CCBC-694)
1074
1075* Experimental CBFT (Full-Text search API)
1076  This version adds a new fulltext api. The API is a row-based API similar
1077  to N1QL and MapReduce. See the `<libcouchbase/cbft.h>` header for more details.
1078  The API is experimental and subject to change.
1079  * Issues: [CCBC-638](https://issues.couchbase.com/browse/CCBC-638)
1080
1081* Allow additional client identifier for HELLO command.
1082  The SDK sends a version string to the server when doing initial negotiation.
1083  The server then uses this string in the context of any logging messages
1084  pertaining to that connection. In this version, a new setting has been added
1085  to allow 'user-defined' version strings to be appended to the logs. Note that
1086  this feature is intended only for use with wrapping SDKs such as Python, node.js
1087  and PHP so that their versions can be present in the log messages as well.
1088  This setting is exposed as a string control (in the connection string, or
1089  `lcb_cntl_string()` with the name of `client_string`.
1090  * Issues: [CCBC-693](https://issues.couchbase.com/browse/CCBC-693)
1091
1092* vBucket retry logic changes.
1093  The client will now retry at constant 100ms rate when receiving not-my-vbucket
1094  error replies from the server (adjustable using `retry_nmv_interval`).
1095  It will also only use fast-forward map to determine the new location for the
1096  vbucket, and will not use extended hueristics.
1097
1098  The most noteworthy user-visible change is the 100ms retry interval which
1099  will significantly decrease the network traffic used by the SDK
1100  during a rebalance.
1101
1102  To restore the pre-2.5.8 behavior (i.e. use extended heuristics and and
1103  exponential retry rate), specify `vb_noguess=false`.
1104  * Priority: Major
1105  * Issues: [CCBC-660](https://issues.couchbase.com/browse/CCBC-660)
1106
1107* Add interface for multi-bucket authentication.
1108  A new API has been added to modify and add additional bucket/password
1109  pairs in the library. This is done using `lcb_cntl` and the `LCB_CNTL_BUCKET_CRED`
1110  setting.
1111
1112  Note that this functionality is not yet used in N1QL queries due to
1113  [MB-16964](https://issues.couchbase.com/browse/MB-16964)
1114  * Priority: Minor
1115  * Issues: [CCBC-661](https://issues.couchbase.com/browse/CCBC-661)
1116
1117
1118## 2.5.7 (March 22 2016)
1119
1120* High-level index management operations.
1121  A volatile API for high level index management operations has been added to
1122  assist in common N1QL index operations such as creating the primary index
1123  and removing indexes.
1124  * Priority: Major
1125  * Issues: [CCBC-662](https://issues.couchbase.com/browse/CCBC-662)
1126
1127* Fix N1QL mutation token queries.
1128  This fixes some bugs in the previous implementation of the way mutation tokens
1129  were handled with `lcb_N1QLPARAMS`. The bugs and fixes only affect consumers
1130  of that API. Couchbase SDKs do not consume this API
1131  * Priority: Minor
1132  * Issues: [CCBC-658](https://issues.couchbase.com/browse/CCBC-658)
1133
1134* Throttle config request retries on empty NMVB responses.
1135  This changes the previous behavior where a new configuration would be
1136  retrieved _immediately_ upon a not-my-vbucket reply if a configuration
1137  was not included within the error reply itself. The new behavior is to
1138  request a delayed retry (i.e. subject to the default throttle settings)
1139  if the current configuration originated from the CCCP (Memcached) provider.
1140  * Priority: Major
1141  * Issues: [CCBC-681](https://issues.couchbase.com/browse/CCBC-681)
1142
1143* Rename `LCB_CLIENT_ETMPFAIL` to `LCB_CLIENT_ENOCONF`.
1144  This error code is returned only when there is no current client configuration.
1145  This error condition is _not_ temporary and is actually fatal; a result of
1146  an initial bootstrapping failure. Note that the older name is still valid
1147  in older code for compatibility purposes.
1148  * Priority: Minor
1149  * Issues: [CCBC-679](https://issues.couchbase.com/browse/CCBC-679)
1150
1151* Include PID in log messages on OS X.
1152  This makes the library logs (via `LCB_LOGLEVEL` etc.) easier to read on a
1153  mac. Previously this used to display only the thread ID, which was identical
1154  for multiple processes. Now the display reads as _pid/tid_, making it easier
1155  to read the logs in a multi-process environment.
1156  * Priority: Minor
1157  * Issues: [CCBC-677](https://issues.couchbase.com/browse/CCBC-677)
1158
1159
1160## 2.5.6 (February 18 2016)
1161
1162* Sub-Document API (_experimental_)
1163  The client-side sub-document API has been implemented. Sub-document is
1164  a feature which vastly reduces network usage when operating on parts
1165  of documents.
1166  The API as it appears in this version is highly experimental and may
1167  (and likely will) change. Examples of use can be found in the `examples/subdoc`
1168  directory.
1169  * Priority: Major
1170
1171* Make `lcb_sched_enter` and `lcb_sched_leave` optional.
1172  When scheduling an operation (e.g. `lcb_get3()`), the scheduling function
1173  will implicitly create a scheduling context and submit the operation if
1174  none exists already. A scheduling context is explicitly created by calling
1175  `lcb_sched_enter()` and finished by calling `lcb_sched_leave()` or
1176  `lcb_sched_fail()`.
1177  * Issues: [CCBC-664](https://issues.couchbase.com/browse/CCBC-664)
1178  * Priority: Major
1179
1180* API3 is now stable.
1181  The scheduling based API, introduced in version 2.4.0 and known as 'api3',
1182  is now stable and considered the API for use with the library.
1183  The previous API (i.e. 'api2') is considered deprecated.
1184
1185  While API3 has been promoted to stable in this version, it has been available
1186  in its current form (and in a mostly compatible manner, _except_ the implicit
1187  scheduling feature - CCBC-664) since 2.4.0.
1188
1189  Storing an item in API2:
1190
1191    lcb_get_store_t cmd = { 0 }, *cmd_p = &cmd;
1192    cmd.v.v0.key = "key";
1193    cmd.v.v0.nkey = 3;
1194    cmd.v.v0.bytes = "value";
1195    cmd.v.v0.nbytes = 5;
1196    cmd.v.v0.operation = LCB_SET;
1197    lcb_store(instance, NULL, 1, &cmd_p);
1198
1199  Storing an item in API3:
1200
1201    lcb_CMDSTORE cmd = { 0 };
1202    LCB_CMD_SET_KEY(&cmd, "key", 3);
1203    LCB_CMD_SET_VALUE(&cmd, "value", 5);
1204    cmd.operation - LCB_SET;
1205    lcb_store3(instance, NULL, &cmd);
1206
1207
1208* Add `libcouchbase/` string to version identification to Memcached
1209  Connections to memcached will now be identified as `libcouchbase/version`
1210  rather than `version`. This increases readability for server logs
1211  * Issues: [CCBC-656](https://issues.couchbase.com/browse/CCBC-656)
1212  * Priority: Minor
1213
1214* Hide `mutation_token` field from API3 mutation respones. The `mutation_token`
1215  field has never been part of the API itself (it was previously present when
1216  api3 was marked as "experimental").
1217  The mutation token for any operation must now be retrieved using the
1218  `lcb_resp_get_mutation_token()` to retrieve the actual mutation token.
1219  * Issues: [CCBC-671](https://issues.couchbase.com/browse/CCBC-671)
1220  * Priority: Minor
1221
1222* Server's `PROTOCOL_BINARY_RESPONSE_EINTERNAL` is no longer mapped to
1223  `LCB_EINTERNAL`. `LCB_UNKNOWN_MEMCACHED_ERROR` will be returned instead
1224
1225* Allow get-and-touch with an expiry of 0.
1226  Clearing a document's expiry with `get` is now possible, using the new
1227  `LCB_CMDGET_F_CLEAREXP` in `lcb_CMDGET::cmdflags`.
1228  * Issues: [CCBC-667](https://issues.couchbase.com/browse/CCBC-667)
1229  * Priority: Major
1230
1231* Allow multiple buckets when using sequence number consistency with N1QL
1232  This uses the new internal `scan_vector` protocol supporting multiple buckets,
1233  each providing their own `lcb_MUTATION_TOKEN` objects.
1234  * Issues: [CCBC-658](https://issues.couchbase.com/browse/CCBC-658)
1235  * Priority: Major
1236
1237## 2.5.5 (January 12 2016)
1238
1239* Add `retry_interval` string option to adjust retry interval.
1240  This allows the setting to be modified via `lcb_cntl_string()` and specified
1241  in the connection string.
1242  * Priority: Major
1243  * Issues: [CCBC-654](https://issues.couchbase.com/browse/CCBC-654)
1244
1245* Handle backslashes in view row ID fields.
1246  This would previously not be handled correctly as the backslashes would not
1247  be removed, for example an ID of `has_a_"quote` would appear in the API as
1248  `has_a_\"quote`. This has been fixed and document IDs are now properly
1249  processed as JSON
1250  * Priority: Major
1251  * Issues: [CCBC-649](https://issues.couchbase.com/browse/CCBC-649)
1252
1253* Allow 'file-only' configuration mode.
1254  This allows applications to make the library instance exclusively configured
1255  from a file on the local filesystem rather than through network bootstrap.
1256  This feature is undocumented and unsupported. It may be enabled using the
1257  `bootstrap_on=file_only` connection string directive.
1258  * Priority: Major
1259  * Issues: [CCBC-652](https://issues.couchbase.com/browse/CCBC-652)
1260
1261* Log when squashing network errors.
1262  This will make the library log the original error whenever a network error
1263  is translated from a more detailed description into `LCB_NETWORK_ERROR`
1264  (in case `detailed_errcodes` is not enabled), or if an OS-level error is
1265  found which cannot be translated into a more specific library error.
1266  * Priority: Major
1267
1268* Fix memcached/ketama hashing
1269  This fixes a bug in the ketama hasing code which caused a key to be mapped
1270  to an effectively arbitrary server for the library instance. In practice the
1271  node a key was mapped to depended on the order in which the hosts were
1272  specified in the connection string. This has been fixed to always use
1273  hashing based on the lexical sort order of each server node.
1274  It is highly recommended that applications upgrade to this version (2.5.5)
1275  for proper memcached (cache) bucket functionality.
1276  * Priority: Critical
1277  * Issues: [CCBC-653](https://issues.couchbase.com/browse/CCBC-653)
1278
1279* Add `cbc-touch` subcommand.
1280  This now allows the simple "touching", or modifying expiration time via the
1281  `cbc` command line client.
1282  * Priority: Major
1283  * Issues: [CCBC-651](https://issues.couchbase.com/browse/CCBC-651)
1284
1285
1286## 2.5.4 (November 25 2015)
1287
1288* Validate vBucket master nodes for bounds when receiving new configuration.
1289  This ensures that invalid configurations (addressing nodes which do not
1290  exist) do not make their way to KV routing operations.
1291  * Priority: Major
1292  * Issues: [CCBC-643](https://issues.couchbase.com/browse/CCBC-643)
1293
1294* Add `lcb_strcbtype` to print the name of the callback type
1295  This small convenience function is added to pretty-print the type
1296  of callback being invoked. The second argument to the callback can be passed
1297  to this function.
1298  * Priority: Minor
1299
1300* Disallow using `certpath` connection string option without explicit SSL
1301  (`couchbases://`) scheme. Since the SSL and non-SSL schemes are similar,
1302  a typo can let a user mistakenly think that SSL is being used. This is
1303  fixed by disallowing the other SSL option (`certpath`) when SSL is not
1304  enabled.
1305  * Priority: Minor
1306  * Issues: [CCBC-644](https://issues.couchbase.com/browse/CCBC-644)
1307
1308* Add convenience function to retrieve hostname for key.
1309  This is an alternative to retrieving the vBucket configuration (via `lcb_cntl()`)
1310  and mapping the key to an index, and mapping the index to a node. Note that
1311  hostnames are sufficient for most but not all configurations. Those running
1312  multiple server instances on the same host (for example, `cluster_run`) will
1313  still need to use the full set of steps as this function does not return a
1314  port. This function is provided both as a vBucket API (`lcbvb_get_hostname()`)
1315  which retrieves the hostname for an index as well as a top-level instance
1316  (`lcb_t`) function (`lcb_get_keynode()`) which accepts a key buffer and length.
1317  * Priority: Minor
1318
1319* Ensure embedded jsoncpp does not throw exceptions.
1320  This caused some build issues with other build systems. This has been fixed
1321  by replacing any exception throwing code with `abort()` and `assert()`
1322  statements.
1323  * Priority: Minor
1324  * Issues: [CCBC-634](https://issues.couchbase.com/browse/CCBC-634)
1325
1326* Log vBucket configuration parsing failures.
1327  This logs vBucket configuration parsing failures when a given config received
1328  could not be parsed. Parsing failures include both JSON syntax errors as well
1329  as improper fields or values within the config itself.
1330  * Priority: Major
1331  * Issues: [CCBC-647](https://issues.couchbase.com/browse/CCBC-647)
1332
1333* Allow per-request N1QL timeouts to exceed global timeouts.
1334  This scans the `"timeout"` property of the N1QL request and if set, will
1335  make the value of this property the timeout value for the request. A small
1336  parser was implemented which converted the N1QL timeout values (`s`, `h`, etc.)
1337  into microseconds.
1338  * Priority: Major
1339  * Issues: [CCBC-660](https://issues.couchbase.com/browse/CCBC-660)
1340
1341* Request configuration refresh when HTTP API redirects are received.
1342  Redirects in Couchbase Server are sent when a node is about to exit the
1343  cluster. We should take this as a sign to refresh the config since it indicates
1344  a node is about to be removed.
1345  * Priority: Major
1346  * Issues: [CCBC-646](https://issues.couchbase.com/browse/CCBC-646)
1347
1348
1349## 2.5.3 (August 27 2015)
1350
1351* Add N1QL timeout feature.
1352  This allows an independent timeout setting for N1QL. Previously this would
1353  use the views timeout.
1354  * Priority: Major
1355  * Issues: [CCBC-631](https://issues.couchbase.com/browse/CCBC-631)
1356
1357* Add N1QL prepared statements.
1358  This allows prepared statements to be used with N1QL. The library will
1359  maintain an internal "prepared statement cache" which contains cached
1360  responses for internal PREPARE requests. To use a prepared statement, an
1361  application can simply set the `LCB_CMDN1QL_F_PREPCACHE` bit in the
1362  `cmdflags` field within the `lcb_CMDN1QL` structure. All the rest is
1363  handled internally within the library.
1364  * Priority: Major
1365  * Issues: [CCBC-633](https://issues.couchbase.com/browse/CCBC-633)
1366
1367## 2.5.2 (July 23 2015)
1368
1369* Fix off-by-one error when populating documents with pillowfight.
1370  Previously pillowfight would only populate N-1 documents where N
1371  is the (`-I`, `--num-items`) option. This has been fixed.
1372  * Priority: Minor
1373
1374* Don't generate negative keys for pillowfight.
1375  For certain option configurations, pillowfight would generate negative keys
1376  (some keys were in the format of -nnnnnn).
1377  * Priority: Minor
1378
1379* Allow in-progress N1QL requests to be cancelled.
1380  This allows in-progress N1QL requests to be cancelled by adding a new API,
1381  `lcb_n1ql_cancel()`. Invoking this function on an `lcb_N1QLHANDLE` handle
1382  (obtained via an _out_ parameter in the command structure) will effectively
1383  stop the request and stop delivering callbacks to the user.
1384  * Priority: Major
1385  * Issues: [CCBC-619](https://issues.couchbase.com/browse/CCBC-619)
1386
1387* Rename `lcb_SYNCTOKEN` to `lcb_MUTATION_TOKEN`.
1388  This experimental (volatile) API has been renamed to "Mutation Token" to
1389  better reflect naming conventions found in other client libraries.
1390  * Priority: Minor
1391
1392* Implement histogram/timings information for N1QL queries via `cbc-n1qlback`.
1393  This adds support for the (`-T`, `--timings`) option in the
1394  `cbc-n1qlback` benchmark/stress-test utility. These timings reflect the
1395  latency between issuing the query and the receipt of the first row of the
1396  resultset.
1397  * Priority: Major
1398  * Issues: [CCBC-624](https://issues.couchbase.com/browse/CCBC-624)
1399
1400* Add (`-M`, `--mode`) option to `cbc-create` to allow for upsert, insert, etc.
1401  This allows `cbc-create` to use the full gamut of storage options available
1402  via the SDK by allowing an insert/upsert/replace mode as an argument to the
1403  new `--mode` option. `append` and `prepend` are now also provided as options,
1404  though not documented.
1405  * Priority: Major
1406  * Issues: [CCBC-625](https://issues.couchbase.com/browse/CCBC-625)
1407
1408* Support `CBC_CONFIG` environment variable for command line tools.
1409  This variable specifies a path to an alternate `cbcrc` file which may be
1410  used to provide cluster/bucket settings. This new option allows multiple
1411  configurations to coexist, without forcing any one of them to be inside the
1412  user's home directory.
1413  * Priority: Minor
1414  * Issues: [CCBC-626](https://issues.couchbase.com/browse/CCBC-626)
1415
1416
1417## 2.5.1 (June 17 2015)
1418
1419Bug fixes and improvements in 2.5.1
1420
1421* Fix hanging in durability operations if node is not present and constraints
1422  include failed node. This condition may be triggered when only a single node
1423  remains in the broadcast probe and a command sent to it could not be scheduled.
1424  A symptom of this bug was durability operations 'hanging'
1425  * Priority: Major
1426  * Issues: [CCBC-607](http://issues.couchbase.com/browse/CCBC-607)
1427
1428* Improved handling of topology changes when non-data (N1QL, Index) nodes are
1429  part of the cluster. This fixes some issues (mainly crashes) when non-data
1430  nodes are found inside the cluster during a topology change. While the library
1431  since version 2.4.8 was able to handle initial bootstrapping with non-data
1432  nodes, it would still crash when such nodes were encountered during
1433  configuration changes.
1434  * Priority: Major
1435  * Issues: [CCBC-609](http://issues.couchbase.com/browse/CCBC-609),
1436    [CCBC-612](http://issues.couchbase.com/browse/CCBC-612)
1437
1438* Improved random host selection algorithm for REST services
1439  This new algorithm ensures that the distribution is even among all _eligible_
1440  nodes for a given service. The old algorithm would only distribute evenly when
1441  the assumption that all nodes contained the same services were true. However
1442  this assumption is no longer necessarily true with Couchbase 4.0. In this case
1443  the algorithm ensures that the random selection inspects only the pool of
1444  nodes which are known to have a given service enabled.
1445  * Priority: Major
1446  * Issues: [CCBC-611](http://issues.couchbase.com/browse/CCBC-611)
1447
1448* Ensure ketama/Memcached-bucket hashing works correctly when non-data nodes
1449  are part of the cluster. In previous versions, ketama hashing would incorrectly
1450  consider all nodes as candidates for keys, which would result in some items
1451  being routed to non-data nodes, resulting in odd errors and inaccessible
1452  data. This is only an issue for the still-unreleased Couchbase 4.0.
1453  * Priority: Major
1454  * Issues: [CCBC-613](http://issues.couchbase.com/browse/CCBC-613)
1455
1456* Set `TCP_NODELAY` as a server side option, if it's enabled on the client.
1457  This uses the `HELLO` protocol functionality to enable this feature, if
1458  this feature is also enabled on the client (enabled by default).
1459
1460
1461New features in 2.5.1
1462
1463* Add `cmake/configure` option for enabling the embedding of the libevent
1464  plugin. This option, named `--enable-embedded-libevent-plugin`, will cause
1465  the plugin to be linked in with the core library (_libcouchbase_) rather
1466  than built as its own object
1467  * Priority: Minor
1468
1469* Add new combined "Store-with-durability" operation. This new API, called
1470  `lcb_storedur3()` allows specifying the storage input options as well as
1471  the associated durability options in a single command. Likewise, the status
1472  of the operation (including durability) is returned in the operation's
1473  callback.
1474  * Priority: Major
1475  * Issues: [CCBC-616](http://issues.couchbase.com/browse/CCBC-616)
1476
1477
1478## 2.5.0 (May 12 2015)
1479
1480This change in the major version number signals the addition of new features
1481for Couchbase Server 4.0; most of the actual new functionality for Couchbase
14824.0 has already been included (incrementally) in prior 2.4.x versions. The
1483new 2.5 version is built on the 2.4.x codebase.
1484
1485* Add `cbc-n1qlback` - a simple benchmark for N1QL queries. This functions
1486  by executing a line-delimited file containing query bodies using multiple
1487  threads if possible.
1488  * Priority: Major
1489  * Issues: [CCBC-604](http://issues.couchbase.com/browse/CCBC-604)
1490
1491* `TCP_NODELAY` functionality has now been placed into effect. This
1492  functionality was nominally present in prior versions, but would not work
1493  because of a typo.
1494  * Priority: Minor
1495
1496* Add 'tick' or 'pump' mode for I/O
1497  As an alternative to `lcb_wait()`, applications may call `lcb_tick_nowait()`
1498  to incrementally perform (non-blocking) I/O. This may provide a performance
1499  boost when batching/scheduling many operations. `lcb_wait()` itself must be
1500  called to guarantee completion of all operations, and the `lcb_tick_nowait()`
1501  functionality is only available on some I/O plugins. See the API docs for
1502  more information.
1503  * Priority: Major
1504  * Issues: [CCBC-598](http://issues.couchbase.com/browse/CCBC-598)
1505
1506* Allow "console logger" to log to a file
1507  As a convenience, it is now possible to direct the library to write to
1508  a log file rather than standard error. This is possible using the
1509  `LCB_CNTL_CONLOGGER_FP` (to programmatically set a `FILE*` value via
1510  `lcb_cntl()`) or `console_log_file` to set the path of the file (which
1511  will be overwritten) via `lcb_cntl_string()` or the connection string.
1512
1513* Make `lcb_N1QLPARAMS` repeatable/debuggable
1514  This allows the `lcb_n1p_mkcmd()` call to be invoked multiple times without
1515  actually modifying internal state. Previously calling this function twice
1516  would result in corruption of the internal parameter state. In this version,
1517  a new function, `lcb_n1p_encode()` has been added (which `lcb_n1p_mkcmd()`
1518  wraps) which may be used to inspect the encoded form of the query.
1519
1520## 2.4.9 (April 14 2015)
1521
1522* Disable HTTP provider when any CCCP config is received.
1523  This makes the assumption that CCCP will always be available if even a
1524  single node provides an HTTP configuration. This change may break some
1525  corner-case upgrade scenarios from version 2.2 to 2.5 where a newly added
1526  2.5 node is subsequently removed.
1527  * Priority: Major
1528  * Issues: [CCBC-526](http://issues.couchbase.com/browse/CCBC-526),
1529    [CCBC-589](http://issues.couchbase.com/browse/CCBC-589)
1530
1531* Fix additional missing defines for UV's `EAI_*` symbols
1532  This was not entirely fixed in 2.4.8, since some undefined macros still
1533  remained.
1534  * Priority: Major
1535  * Issues: [CCBC-596](http://issues.couchbase.com/browse/CCBC-596)
1536
1537* Make connection string timeout parameters (e.g. `operation_timeout`) always
1538  specify seconds; this will no longer require the decimal point to be used,
1539  but will break any prior usages of this value for microseconds.
1540  * Priority: Minor
1541  * Issues: [CCBC-597](http://issues.couchbase.com/browse/CCBC-597)
1542
1543* Add `cbc n1ql` subcommand, which executes N1QL queries.
1544  This subcommand is still a bit rough around the edges, mainly because of
1545  server-side support for "pretty=false" (which makes the rows display rather
1546  weirdly).
1547  * Priority: Major
1548  * Issues: [CCBC-595](http://issues.couchbase.com/browse/CCBC-595)
1549
1550* Allow usage of `-D` option in `cbc` and `cbc-pillowfight` tools.
1551  This flag allows specifying connection string options in a more
1552  concise form on the commandline. The `-D` option may be specified
1553  multiple times in the form of `-Doption=value`.
1554  * Priority: Minor
1555
1556* Interpret `couchbase://host:8091` connection string as `couchbase://host`
1557  Previously the library would treat `8091` as a memcached port. While technically
1558  correct according to the connection string semantics, would often be a
1559  source of confusion for users migrating from older versions of the library
1560  (or other SDKs) when using the form `http://host:8091`. A special provision
1561  is thus made for such a cas.
1562  * Priority: Major
1563  * Issues: [CCBC-599](http://issues.couchbase.com/browse/CCBC-599)
1564
1565* Implement enhanced durability using sequence numbers.
1566  This feature is available in Couchbase 4.0, and uses sequence numbers
1567  (optionally specified in the response packet of each mutation).
1568  sequence-based durability constraints help resolve some ambiguity in
1569  the case of checking the durability of items which have since been
1570  mutated, or in the case of a cluster failover. Using this functionality
1571  requires the `LCB_CNTL_FETCH_SYNCTOKENS` (or `fetch_synctokens`) and the
1572  `LCB_CNTL_DURABILITY_SYNCTOKENS` (or `dur_synctokens`)
1573  settings to be enabled (using `lcb_cntl()` or `lcb_cntl_string()`, or
1574  in the connection string). Enabling `LCB_CNTL_FETCH_SYNCTOKENS` will
1575  cause mutation response packets from the server to return an additional
1576  16 bytes of sequence data, and enabling `LCB_CNTL_DURABILITY_SYNCTOKENS`
1577  will cause `lcb_durability_poll()` to transparently use this information
1578  (rather than the CAS) to check for persistence/replication.
1579  **Only available in Couchbase 4.0**. As a result of this feature, much
1580  of the durability subsystem itself has been rewritten, making durability
1581  overall more performant, even for CAS-based durability.
1582  * Priority: Major
1583  * Issues: [CCBC-569](http://issues.couchbase.com/browse/CCBC-569)
1584
1585* Add `lcb_version_g` extern symbol as alternative to `lcb_get_version()`.
1586  This symbol is an extern global which allows simple runtime checking of
1587  the library version. This is more convenient than `lcb_get_version()` as
1588  it avoids the requirement to create a temporary variable on the stack
1589  (`lcb_get_version()` returns a string, and requires an `lcb_U32` pointer
1590  as its first argument to get the actual numeric version).
1591  * Priority: Minor
1592
1593
1594## 2.4.8 (Mar. 8 2015)
1595
1596* Retry next nodes on initial bootstrap, even if first node says bucket does
1597  not exist (or auth error), as this might be a recently removed node
1598  * Priority: Major
1599  * Issues: [CCBC-577](http://issues.couchbase.com/browse/CCBC-577)
1600
1601* The `cbc` and `cbc-pillowfight` binaries on Windows are now distributed
1602  in both _release_ and _debug_ variants. Previously they would be clobbered
1603  by one or the other depending on the build host. This fixes some issues in
1604  performance and dependency resolution when using these libraries.
1605  * Priority: Minor
1606  * Issues: [CCBC-581](http://issues.couchbase.com/browse/CCBC-581)
1607
1608* Provide Read-Only config cache mode. In this mode the configuration cache
1609  file is read but never updated. Additionally, a missing file in this mode
1610  results in a hard error.
1611  * Priority: Major
1612  * Issues: [CCBC-584](http://issues.couchbase.com/browse/CCBC-584)
1613
1614* Keep vBucket heuristic guesses for limited periods of time.
1615  This will allow previously-learned vBucket master locations to persist
1616  over a configuration change, providing these changes were discovered
1617  recently. This allows the reduction of not-my-vbucket responses while
1618  allowing new configs to overwrite our heuristic info, if the heuristic is
1619  too old.
1620  * Priority: Major
1621
1622* Fix potential crashes in get-with-replica (`lcb_rget3`, `lcb_get_replica`)
1623  when there are no replicas available, or if there is an error in retrieving
1624  from one of the replicas.
1625  * Priority: Major
1626  * Issues: [CCBC-586](http://issues.couchbase.com/browse/CCBC-586)
1627
1628* Do not wait between not-my-vbucket retries
1629  This behavior restores the pre 2.4.0 behavior of retrying not-my-vbucket
1630  responses, with a more intelligent retry/rotation algorithm (see the
1631  release note about "vbucket map heuristics"). Previously a wait-time
1632  was introduced because of potential busy loops in retrying to the same
1633  node. The `LCB_CNTL_RETRY_NMV_IMM` setting can be used to disable this
1634  functionality (by disabling it, i.e. setting it to 0). This may also be
1635  disabled in the connection string via `retry_nmv_imm=0`.
1636  * Priority: Major
1637  * Issues: [CCBC-588](http://issues.couchbase.com/browse/CCBC-588)
1638
1639* Fix compilation error with UV when `EAI_BADHINTS` is not defined in the
1640  system. This is primarily an issue with newer UV versions and some versions
1641  of Linux
1642  * Priority: Major
1643  * Issues: [CCBC-590](http://issues.couchbase.com/browse/CCBC-590)
1644
1645* Allow means to disable C++ behavior on public library structures, allowing
1646  them to be initialized via C-style static initializers.
1647  This allows the zeroing of structures such as `lcb_get_cmd_t cmd = { 0 }`,
1648  which would ordinarily fail under C++ compilation because of that structure
1649  having a defined C++ constructor. Applications can take advantage of this
1650  feature by defining the `LCB_NO_DEPR_CXX_CTORS` preprocessor macro when
1651  compiling.
1652  * Priority: Major
1653  * Issues: [CCBC-591](http://issues.couchbase.com/browse/CCBC-591)
1654
1655* Fix some bugs in timing behavior (`lcb_enable_timings`). Timings between
1656  1000-2000ms are now reported accurately. Additionally for more common
1657  handling, second timing ranges (between 1-9s) are reported in ms range
1658  (i.e. timings of 4 seconds are reported as 3000-4000ms ).
1659  * Priority: Minor
1660  * Issues: [CCBC-582](http://issues.couchbase.com/browse/CCBC-582)
1661
1662
1663## 2.4.7 (Feb. 17 2015)
1664
1665* Fix SSL connection failures with `SSL_UNDEFINED_CONST_FUNCTION`.
1666  This would sometimes cause failures during early connection/negotiation
1667  stages.
1668  * Priority: Major
1669  * Issues: [CCBC-571](http://issues.couchbase.com/browse/CCBC-571)
1670
1671* Add _experimental_ support for N1QL queries.
1672  This adds support for contacting N1QL endpoints and retrieving their
1673  result sets. The support at both the client and server components is
1674  still a work in progress.
1675  The API is similar to the view api (see `lcb_view_query()`) added in
1676  version 2.4.6. See details in `<libcouchbase/n1ql.h>`
1677  * Priority: Major
1678  * Issues: [CCBC-572](http://issues.couchbase.com/browse/CCBC-572)
1679
1680* Add _experimental_ support for geospatial view queries.
1681  GeoSpatial views are available as an experimental feature in the
1682  current releases of the server. This will soon be offered as a
1683  stable feature in future releases.
1684  Applications may now use the `lcb_RESPVIEWQUERY::geometry` field
1685  and the `LCB_CMDVIEWQUERY_F_SPATIAL` to utilize geospatial views.
1686  * Priority: Major
1687  * Issues: [CCBC-573](http://issues.couchbase.com/browse/CCBC-573)
1688
1689* Fix memory leak for retried commands.
1690  In cases where a given command needs to be retried more than once, a
1691  memory leak was fixed in which the previous instance of the pacekt was
1692  not properly freed.
1693  * Priority: Major
1694  * Issues: [CCBC-574](http://issues.couchbase.com/browse/CCBC-574)
1695
1696## 2.4.6 (January 20 2015)
1697
1698* Fix floating point exception on OS X.
1699  A floating point exception would sometimes be thrown on OS X sytems due
1700  to bad time structure initialization. The installation provided with
1701  homebrew for 2.4.5 fixed this issue. This is completely fixed in 2.4.6
1702  Priority: Major
1703
1704* Improve warning messages when using deprecated options in `cbc`.
1705  This provides less ambiguous help messages when using deprecated options,
1706  showing a full and complete example for proper usage (when possible).
1707  * Priority: Minor
1708  * Issues: [CCBC-562](http://issues.couchbase.com/browse/CCBC-562)
1709
1710* Add patch/micro version to DLL information on Windows.
1711  This lets the user see the exact version of the library on windows (via
1712  right clicking on the DLL and inspecting the details). Previously this
1713  information contained only the major and minor versions.
1714  * Priority: Minor
1715  * Issues: [CCBC-563](http://issues.couchbase.com/browse/CCBC-563)
1716
1717* Provide _pkgconfig_ (`.pc`) file with installation.
1718  This may help third party applications and libraries link against libcouchbase
1719  in some environments.
1720
1721* Provide one-off `unsafe_optimize` option for connection string/`lcb_cntl`.
1722  This provides a shorter way to enable some potentially unsafe optimizations
1723  which may make the client perform better in some scenarios.
1724  * Priority: Minor
1725
1726* Allow prompting for password in `cbc`.
1727  The `cbc` and `cbc-pillowfight` utilities will now securely prompt for the
1728  password if the password specified on the commandline is a hyphen (`-`).
1729  * Priority: Minor
1730  * Issues: [CCBC-565](http://issues.couchbase.com/browse/CCBC-565)
1731
1732* Fix timeouts in some durability when not all replicas are online.
1733  The library will now fail the operation with `LCB_DURABILITY_ETOOMANY`
1734  rather than allowing the operation to timeout.
1735  * Priority: Major
1736  * Issues: [CCBC-560](http://issues.couchbase.com/browse/CCBC-560)
1737
1738* Add high level row-based view functionality.
1739  This adds a new API (currently considered _volatile_) which allows
1740  intelligently querying views. This builds atop the basic HTTP
1741  interface, and exposes a row-based callback API based upon
1742  streaming JSON parsing. The new API is defined in `<libcouchbase/views.h>`.
1743  This API will become more stable over time.
1744  * Priority: Major
1745  * Issues: [CCBC-100](http://issues.couchbase.com/browse/CCBC-100)
1746
1747* Parse configuration service locations for experimental services
1748  This exposes the N1QL and indexing services via the _lcbvb_ API. See
1749  `libcouchbase/vbucket.h` for more information.
1750
1751## 2.4.5 (December 17 2014)
1752
1753* Fix `pillowfight` ignoring `set-ratio` values above 50
1754  The program would ignore these values and act as if 100 was specified,
1755  thus never issuing any GET operations
1756  * Priority: Minor
1757  * Issues: [CCBC-550](http://couchbase.com/issues/browse/CCBC-550)
1758
1759* Building with autotools is no longer supported.
1760  If building the library from source, you _must_ use
1761  [CMake](http://cmake.org/download) version 2.8.9 or greater. If unfamiliar
1762  with CMake, the README describes the process. Included also is a top-level
1763  script called `configure.pl` which functions with an autoconf-like interface.
1764  * Priority: Major
1765
1766* Fix customized IOPS crashes in some usage cases
1767  This fixes scenarios where applications assume that the built-in IOPS version
1768  is 0, and attempt to "Subclass" the IOPS structure. The internal version of
1769  the library structure is now 3, with some extra heuristics in place to ensure
1770  that the older code will still function.
1771  This issue was most visible in the Python SDK when using the gevent or Twisted
1772  plugins.
1773  This issue was first introduced with version 2.4.4
1774  * Priority: Critical
1775  * Issues: [CCBC-557](http://couchbase.com/issues/browse/CCBC-557)
1776
1777* Allow raw `certpath` to be passed without need for percent-encoding (in most cases)
1778  This allows for a common pattern fo passing `certpath` in the connection string as
1779  a raw, unencoded path. This allows a user to do
1780  `couchbases://host/bucket?certpath=/foo/bar/baz`.
1781
1782* Fix missing installation UV plugin headers and source
1783  In 2.4.4 this was accidentally left out, and would only be installed if the plugin
1784  itself was built and installed. This affected building the Node.JS SDK using an
1785  existing libcouchbase install.
1786  * Priority: Major
1787  * Issues: [CCBC-558](http://couchbase.com/issues/browse/CCBC-558)
1788
1789## 2.4.4 (Nov. 19 2014)
1790
1791* Detect disconnected pooled sockets
1792  This allows the connection pool to detect dead sockets which were closed
1793  by a server when they were idle. Sometimes servers will close connections
1794  to open idle sockets to save resources, or because of bugs in their
1795  implementations.
1796  This will fix some issues experienced with views where queries would
1797  randomly fail with `LCB_NETWORK_ERROR` or `LCB_ESOCKSHUTDOWN`, by first
1798  checking if the socket is alive before returning it back to the library's
1799  core.
1800  Note that the `libuv` plugin does not implement this functionality yet.
1801  * Priority: Critical
1802  * Issues: [CCBC-546](http://couchbase.com/issues/browse/CCBC-546)
1803
1804* Fix _pillowfight_ `--min-size` bug
1805  This fixes a bug where pillowfight would sometimes compare the `min-size`
1806  option to an uninitialized `max-size` option and round it down to that
1807  value; then would set the `max-size` option.
1808  * Priority: Major
1809  * Issues: [CCBC-542](http://couchbase.com/issues/browse/CCBC-542)
1810
1811* Don't ignore `LCB_CNTL_DURABILITY_INTERVAL`
1812  Fix a bug where this interval would be ignored, if modified by the user; always
1813  reverting to 100ms.
1814  * Priority: Major
1815  * Issues: [CCBC-543](http://couchbase.com/issues/browse/CCBC-543)
1816
1817* Fix memory leak with HTTP requests using a request body
1818  Requests (such as `PUT`, `POST`, etc) which contained a request body
1819  would cause a memory leak as the library forgot to free them when the
1820  request object was destroyed.
1821  * Priority: Major
1822  * Issues: [CCBC-538](http://couchbase.com/issues/browse/CCBC-538)
1823
1824* Fix errneous `LCB_SUCCESS` return when passed duplicate keys to
1825  `lcb_durability_poll()`. This would cause applications to mistakenly wait
1826  for a callback to arrive, when in fact the command had failed.
1827  * Priority: Major
1828  * Issues: [CCBC-536](http://couchbase.com/issues/browse/CCBC-535)
1829
1830* Add option to preserve vbucket ownership heuristics across config updates
1831  This allows the learned configuration settings to persist between configuration
1832  updates. The default behavior (up to, and including this change) is to
1833  discard any "learned" configuration in favor of the explicitly new config
1834  passed to the server. This new option allows this information to be persisted
1835  when a new configuration update is received. This behavior is considered
1836  experimental, and is primarily intended to reduce the time it takes for the
1837  client to relearn the current node (which is typically under 1-2 seconds).
1838  * Priority: Minor
1839  * Issues: [CCBC-530](http://couchbase.com/issues/browse/CCBC-530)
1840
1841* Relocate memcached packets on topology changes for memcached buckets
1842  This enhances the behavior of the client when operating with a memcached
1843  bucket during a topology change. Previously the library would not relocate
1844  packets to new servers, resulting in errors for items which were now
1845  mapped to wrong nodes. The new behavior remaps the key to the new server
1846  using the updated ketama hashing. Note that as a current restriction, the
1847  remapping will be performed based on the key of the item, not any `hashkey`
1848  parameter being employed.
1849  * Priority: Major
1850  * Issues: [CCBC-331](http://couchbase.com/issues/browse/CCBC-331)
1851
1852* Return error if ignored/conflicting options are found
1853  This changes the behavior of the library to throw an error if a specific
1854  option field was filled in which did not make sense for a given command, for
1855  example, specifying a `cas` value using a `LCB_ADD` operation with `lcb_store`.
1856  * Priority: Major
1857  * Issues: [CCBC-529](http://couchbase.com/issues/browse/CCBC-529)
1858
1859* Fix issue when sending out large _OBSERVE_ command.
1860  This would cause a partial command to be sent out if the size of the output
1861  packet was greater than 512 bytes. This has been fixed by dynamically growing
1862  the output buffer for _OBSERVE_
1863  * Priority: Minor
1864  * Issues: [CCBC-528](http://couchbase.com/issues/browse/CCBC-528)
1865
1866* Fix spurious timeouts when using `lcb_durability_poll`
1867  This fixes an issue where sometimes the durability poll operation would
1868  prematurely time out.
1869  * Priority: Major
1870  * Issues: [CCBC-527](http://couchbase.com/issues/browse/CCBC-527)
1871
1872## 2.4.3 (Oct. 21 2014)
1873
1874* Disable support for SSLv3
1875  This works around the _POODLE_ SSLv3 vulnerability by disabling support for
1876  anything below TLSv1.
1877
1878  * Priority: Critical
1879  * Issues: [CCBC-523](http://couchbase.com/issues/browse/CCBC-523)
1880
1881* Pillowfight enhancements
1882  Several behavior changes were made to pillowfight in this version. These are:
1883  * The `-l` or `-c -1` option is in effect by default. This means that by
1884    default `pillowfight` will run an infinite number of cycles. The previous
1885    behavior was to default to a single cycle, requiring an explicit `--loop`
1886    to ensure the workload ran for a considerable amount of time.
1887
1888  * When multiple threads are used, the workload is divided among the threads,
1889    thus making it that each thread only operates on a subset of the data.
1890
1891  * A `--sequential` option has been added to allow the workload to operate
1892    in _sequence_ on the total number of items. This is useful when wishing to
1893    load a bucket with many items.
1894
1895  * A `--start-at` option has been added to allow the workload to specify an
1896    alternate range of keys; effectively allowing resumption of a previous
1897    run. The `--start-at` flag allows to specify the lower bound number which
1898    will be used to generate keys. Thus a `--num-items=20000` and a
1899    `--start-at=10000` will generate keys from 10000 through 30000.
1900
1901  * The _population_ phase has now been merged with the general workload
1902    implementation. This means that all worker threads will participate in
1903    the population phase. The previous behavior limited the populate phase to
1904    a single thread.
1905
1906  * If `stdout` is detected to be a terminal, a simple "OPS/SEC" meter will
1907    periodically write the estimated throughput to the screen.
1908
1909* Fix memory leak when using large read buffers
1910  In the case where large read buffers are used (and the `iovec` elements
1911  becomes sizable, the library may end up incorrectly caching some memory
1912  blocks for future use. This fix makes the blocks be cached at the allocator
1913  level, so that they are properly (re) utilized.
1914
1915  * Priority: Major
1916  * Issues: [CCBC-519](http://couchbase.com/issue/browse/CCBC-519)
1917
1918* Use forward map (and other heuristics) to get a next node for an item after
1919  a not-my-vbucket reply. Since the server (see bug attached) does not always
1920  guarantee that a given config is the most _correct_, the client must do some
1921  guesswork in order to properly map a node when it gets a not-my-vbucket;
1922  especially if the config says that the node is the correct one.
1923
1924  * Priority: Major
1925  * Issues: [MB-12268](http://couchbase.com/issues/browse/MB-12268)
1926
1927## 2.4.2 (Sep. 23 2014)
1928
1929* Mark the `hashkey` fields as being _volatile_.
1930  Usage of this field is not supported in many cluster systems and is thus not
1931  supported functionality. It exists primarily as a legacy from an older API
1932  * Priority: Major
1933  * Issues: [CCBC-508](http://couchbase.com/issues/browse/CCBC-508)
1934
1935* Add "key stats" mode to `lcb_CMDDSTATS`.
1936  This adds an additional key stats mode to the `lcb_stats3()` API
1937  which interprets the `key` field as being a document ID for which
1938  information (such as expiry, status) should be retrieved, rather
1939  than a system statistics key. Similar functionality already exists
1940  in the Java client library as `getKeyStats()`. In addition to this
1941  feature, a `cbc stats --keystats` option is also provided to employ
1942  this functionality from the command line.
1943  * Priority: Major
1944  * Issues: [CCBC-318](http://issues.couchbase.com/browse/CCBC-318)
1945
1946* Add more details about replica nodes in the `cbc hash` command.
1947  * Priority: Minor
1948  * Issues: [CCBC-504](http://couchbase.com/issues/browse/CCBC-504)
1949
1950* Add `lcb_cntl()` setting to retrieve bucket name.
1951  Previously the library did not have a means by which the bucket name
1952  could be retrieved. Using the `LCB_CNTL_BUCKETNAME` setting, the bucket
1953  name will now be returned.
1954  * Priority: Major
1955  * Issues: [CCBC-502](http://issues.couchbase.com/browse/CCBC-502)
1956
1957## 2.4.1
1958
1959
1960* Implement `mcflush` subcommand for `cbc`. This was removed in the cbc
1961  rewrite as the previous `flush` command.
1962  * Priority: Minor
1963  * Issues: [CCBC-486](http://couchbase.com/issues/browse/CCBC-486)
1964
1965
1966* Requests issued to an invalid replica via `lcb_get_replica()` should fail
1967  with the `LCB_NO_MATCHING_SERVER_CODE`. Previously this sometimes went
1968  through due to an incorrect bounds checking in the `lcbvb_vbreplica()`
1969  function.
1970  * Priority: Major
1971  * Issues: [CCBC-488](http://couchbase.com/issues/browse/CCBC-488)
1972
1973
1974* Fixed a memory leak in `lcb_get_replica()` when the operation would fail.
1975  * Priority: Major
1976  * Issues: [CCBC-489](http://couchbase.com/issues/browse/CCBC-489)
1977    [CCBC-490](http://couchbase.com/issues/browse/CCBC-490)
1978
1979
1980
1981* Fix memory leak in `lcb_sched_fail()` when extended commands are in the
1982  pipeline
1983  * Priority: Major
1984  * Issues: [CCBC-474](http://couchbase.com/issues/browse/CCBC-474)
1985
1986
1987
1988* Provide `lcb_dump()` function call to dump state information about
1989  a client handle. The function call itself is currently marked as
1990  volatile and the output format is very much likely to change.
1991  * Priority: Minor
1992  * Issues: [CCBC-491](http://couchbase.com/issues/browse/CCBC-490)
1993
1994
1995* Fix `ratio` argument in `cbc-pillowfight`. This ensures that the
1996  `ratio` argument will truly determine the ratio of gets to sets.
1997  * Priority: Minor
1998
1999* Fix crash when HTTP request is retried. This may take place during topology
2000  changes
2001  * Priority: Major
2002  * Issues: [CCBC-497](http://couchbase.com/issues/browse/CCBC-497)
2003
2004* Allow simple host-port string in connection string, giving it an implicit
2005  `http://` scheme. This allows easier backwards compatibility with some
2006  application
2007  * Priority: Minor
2008  * Issues: [CCBC-500](http://couchbase.com/issues/browse/CCBC-500)
2009
2010* Update some SSL options to better reflect server 3.0 functionality
2011  The old `capath` option has been renamed to `certpath` to indicate that the
2012  path is not to the signing authority, but to the self-signed server certificate
2013  generated by the server itself. Additionally the `no_verify` option has been
2014  hidden.
2015  * Priority: Major
2016  * Issues: [CCBC-501](http://couchbase.com/issues/browse/CCBC-501)
2017
2018## 2.4.0 GA
2019
2020* [major] Attempt to retry items that are mapped to a non-existent node in
2021  a degraded cluster. Rather than returning `LCB_NO_MATCHING_SERVER` the
2022  behavior should be to wait for the item to succeed and attempt to fetch
2023  a new cluster configuration.
2024
2025  In order to control how such 'orphaned' commands are handled, a new value
2026  has been added to the `lcb_RETRYMODEOPTS` called `LCB_RETRY_ON_MISSINGNODE`
2027  which dictates how commands should be rescheduled if the associated vbucket
2028  has no master. The default is to retry the command until it times out, but
2029  by setting this value to `0` (See `LCB_CNTL_RETRYMODE`) it may only be
2030  attempted once, causing 'fail fast' behavior in such a case.
2031
2032* [major] Don't throttle config requests based on initial file-based config.
2033  This allows the client to quickly recover from a stale config cache without
2034  waiting for the `LCB_CNTL_CONFDELAY_THRESH` interval to elapse. Prior to this
2035  fix, a client would appear to "not recover" if bootstrapping from a stale cache.
2036  In reality the client would eventually recover but was waiting for the delay
2037  threshold to elapse.
2038
2039* [major] Ignore `NOT_MY_VBUCKET` config payloads if CCCP provider is disabled.
2040  This allows the client to circumvent any possible bugs in the CCCP response
2041  payload and rely entirely on the HTTP config. It also allows 'rewriting'
2042  proxies like confsed to function.
2043
2044## 2.4.0-beta
2045
2046* [major] Better error reporting for SSL failures.
2047  This adds new error codes (`LCB_SSL_ERROR`, `LCB_SSL_CANTVERIFY`)
2048  which are returned on initialization and verification failures
2049  respectively.
2050
2051* [minor] Communication via legacy memcached servers is possible
2052  by using the `memcached://` scheme in the connection string.
2053
2054* [minor] Environment variables understood by the library are now
2055  documented in their own section.
2056
2057* [major] Add `lcb_get_node()` function to retrieve addresses for
2058  various nodes in the cluster. This deprecates the `lcb_get_host()`,
2059  `lcb_get_port()` and `lcb_get_server_list()` functions as they are
2060  constrained to only return information about the administrative API.
2061  The new function is configurable to return information about various
2062  ports.
2063
2064* [major] The `dsn` field in the `lcb_create_st` structure has been
2065  renamed to `connstr`.
2066
2067* [major] An HTTP request which has followed redirects will cause the
2068  `lcb_wait()` function to never return. This bug was introduced in
2069  2.4.0-DP1 and has now been fixed.
2070
2071* [minor] `lcb_get_server_list()` function now returns updated information
2072  from the current cluster configuration. Previously this would only return
2073  a node from the list specified during initial creation.
2074
2075* [minor] Provide additional error classifiers. Two error classifiers have
2076  been added, they are:
2077
2078  * `LCB_ERRTYPE_SRVLOAD` which indicates that the server is likely under high load.
2079  * `LCB_ERRTYPE_SRVGEN` which indicates that the error is a direct reply from the
2080    server. This code can help distinguish between client and server generated
2081    return codes.
2082
2083* [major] Provide HTTP keepalive and connection pooling for HTTP requests.
2084  This allows the client to reuse an HTTP connection for multiple requests
2085  rather than creating a new connection and closing it for each operation.
2086
2087  The functionality may be controlled via the `LCB_CNTL_HTTP_POOLSIZE` setting
2088  which limits how many open connections (per server) to maintain inside the
2089  client. Setting this value to `0` will disable pooling and restore old
2090  behavior.
2091
2092* [major] Properly schedule next invocations for retry queue. A bug was introduced
2093  in 2.4.0-dp1 which would cause the next tick callback to be invoked in what is
2094  effectively a busy loop. This would be reflected in higher CPU load and less
2095  throughput during topology changes.
2096
2097* [major] Return error if empty key is passed to an operation. Empty keys will
2098  cause the server to drop the connection.
2099  The error code returned is the newly added `LCB_EMPTY_KEY`
2100
2101* [minor] Provide setting to disable refreshing the configuration when an HTTP
2102  API error is encountered (from one of the HTTP callback functions). This
2103  adds the `LCB_CNTL_HTTP_REFRESH_CONFIG_ON_ERROR` setting.
2104
2105* [major] Fix bug where the CCCP provider may prematurely fail, activating the
2106  HTTP provider
2107
2108
2109## 2.4.0-dp1 (2014-06-18)
2110
2111
2112**Changes affecting older APIs**
2113
2114* [minor] Make `run_event_loop` and `stop_event_loop` private.
2115  These functions may no longer be used from within an application to
2116  start/stop the event loop. `lcb_wait()` and `lcb_wait3()` should be
2117  used instead.
2118
2119* [major] Deprecate the `lcb_set_XXX` functions. `lcb_set_timeout`
2120  and some other calls have been deprecated in favor of the `lcb_cntl()`
2121  interface. These functions will still work but will cause the compiler
2122  to print a deprecation warning.
2123
2124* [minor] `lcb_socket_t` is typedefed to a `DWORD` on windows. In
2125  previous versions this was an `int`.
2126
2127* [minor] Connecting to a standalone memcached instance is currently no longer
2128  supported.
2129
2130* [major] `lcb_set_error_callback()` has been deprecated. Applications should
2131  use the new `lcb_set_bootstrap_callback()` and/or operation callbacks
2132  to determine success/failure status.
2133
2134* [major] `lcb_get_last_error()` has been deprecated. Error information is always
2135  returned in the operation callback
2136
2137* [major] Disable the sending of `GETQ` packets. The format of this command
2138  is cumbersome to deal with and in most uses cases is actually slightly
2139  _less_ efficient on the network. Note that this does not change the API
2140  of the actual `lcb_get()` call, but simply changes the format of the
2141  packets sent over the wire.
2142
2143* [major] The IOPS API has been changed. This is considered volatile interface
2144  and may subsequently change in the future as well.
2145
2146**New APIs added in 2.4.0 extending existing functionality**
2147
2148These changes extend existing features with enhanced APIs
2149
2150* [major] Additional APIs for `lcb_cntl()`. These consist of helper functions
2151  to make it easier to use simple types or strings rather than pointers, if
2152  possible. These functions are `lcb_cntl_string()`, `lcb_cntl_setu32()` and
2153  `lcb_cntl_getu32()`
2154
2155* [minor] Provide extended version of `lcb_wait()`.
2156  A new function called `lcb_wait3()` has been added which offers additional
2157  options with respect to running the event loop. Specifically it offers to
2158  bypass the check for pending operations which `lcb_wait()` executes. This
2159  is both more performant and allows us to wait for operations which are
2160  not explicitly scheduled.
2161
2162* [major] Provide API to request a configuration refresh.
2163  Sometimes it is necessary to force the client to request a new configuration,
2164  for example in certain failover conditions. A new API called `lcb_config_refresh()`
2165  has been added, and should be used in conjunction with `lcb_wait3()`.
2166
2167* [major] Provide bootstrapping notification callback
2168  This provides an explicit `lcb_set_bootstrap_callback()` to definitively
2169  determine whether the client has received its initial configuration (and
2170  thus may now start performing operations) or whether it failed (and thus
2171  must be reinitialized). This deprecates the common use case of
2172  `lcb_set_error_callback()`.
2173
2174* [major] New vBucket interface/API. This API is used internally and exposed
2175  as _volatile_ inside the public header files. It provides extended features,
2176  a more concise API, and is compatible with the upcoming Couchbase 3.0 config
2177  format. Note that file-based configuration caches written by this version of
2178  the library are incompatible with previous versions, however this version may
2179  read caches generated by previous versions. This is because this version generates
2180  a stripped-down version of the "terse" configuration style.
2181
2182* [major] Extended detailed error codes.
2183  These error codes expose more detail about the `NETWORK_ERROR` and
2184  `CONNECT_ERROR` codes returned by previous versions of the library. The extended
2185  codes are not returned by default and must be explicitly enabled in order to
2186  retain backwards compatibility with applications which rely on the older
2187  error codes.
2188
2189
2190**New Features in 2.4.0**
2191
2192* [major] Connection Strings (aka "dsn") feature for instance creation. This adds a new
2193  version of the `lcb_create_st` structure which is passed a URI-like string
2194  rather than a semicolon-delimited list of hosts. This string is used to
2195  provide options and the list of hosts that the library should connect to.
2196  For example, `couchbase://default/localhost&compression=off`
2197
2198* [major] SSL transport support for Couchbase 3.0 Enterprise.
2199  Couchbase 3.0 enterprise features the ability to encrypt communications
2200  between the client and the server using the SSL protocol. SSL protocol
2201  support in _libcouchbase_.
2202
2203* [major] Retry queue for failed operations. The retry queue is used
2204  as a place to place operations which have failed internally and which
2205  should be retried within a certain amount of time. This also provides
2206  options on which commands should be retried.
2207
2208* [minor] Compression/JSON flag (aka Datatype) support
2209  This adds support for a future feature of Couchbase server which will
2210  feature transparent compression. This feature also allows the server
2211  to signal to the library if a document is JSON or not. The compression
2212  feature may be disabled at compile-time, and may also be modified at
2213  runtime by setting `compression=off` in either the connection string
2214  or via `lcb_cntl_setstring(instance, "compression", "off")`
2215
2216* [major] Experimental _scheduling_ API. This API replaces most of the older
2217  operation APIs with a scheduling API. These APIs are called with one
2218  command at a time and insert the resultant packet into a pipeline. The
2219  user may "schedule" the commands or "fail" the pipeline if a certain
2220  request has failed to be scheduled.
2221
2222  This API also provides a common ABI header for commands so that they may
2223  easily be used via type-punning, or wrapped as a class hierarchy in C++.
2224
2225  This API is currently considered volatile but will be the basis of the
2226  upcoming libcouchbase 3.0 API. The header file is `<libcouchbase/api3.h>`
2227
2228* [major] Raw memcached packets may be sent to the library and have a callback
2229  invoked when their responses have been received.
2230  This adds an `lcb_pktfwd3()` API. This requires the new scheduling API.
2231
2232
2233**Bug Fixes in 2.4.0**
2234
2235* [major] _select_ plugin may endlessly loop in some cases
2236  The plugin may loop if there was a long timeout from the
2237  future .
2238
2239* [major] Do not break TCP connections on topology changes unless ejected from
2240  cluster. This ensures that nodes which are still part of the cluster have their
2241  TCP connections remain in tact despite being shifted in their server index values.
2242  Packets which have been sent to the wrong vBucket are silently ignored and
2243  rescheduled to their appropriate destination. This decreases load significantly
2244  on the client, network, and cluster during topology changes.
2245
2246* [major] Use new-style "Terse" URI format when requesting a configuration over HTTP.
2247  This uses the HTTP configuration format over the new `/pools/default/bs/default`
2248  rather than the older `/pools/default/bucketsStreaming/default` form. The former
2249  form is much more efficient on the cluster side. If the new URI form is not
2250  supported (i.e. the server responds with an HTTP 404) the older form will be
2251  used instead. You may modify this behavior by setting the `LCB_CNTL_HTCONFIG_URLTYPE`
2252  setting via `lcb_cntl()`.
2253
2254* [minor] The `cmake/configure` script now accepts the `LDFLAGS`, `CPPFLAGS`, `CFLAGS`,
2255  `CXXFLAGS`, `CC`, and `CXX` settings both within the environment _and_ the
2256  commandline, so the forms of `CC=clang ./cmake/configure` and
2257  `./cmake/configure CC=clang` are equivalent.
2258
2259* [minor] The `pillowfight` tool will now print latencies between 1-10ms in resolutions
2260  of 100us.
2261
2262
2263**Metadata and Packaging Changes in 2.4.0**
2264
2265* [major] Use Doxygen for API documentation.
2266  This replaces the _manpages_ for API documentation with Doxygen. Doxygen
2267  is a free and portable documentation system which may be obtained from your
2268  distribution or at [](http://doxygen.org). To generate the documentation
2269  from the source tree, simply run `doxygen` from the source root directory.
2270  To generate internal documentation, run `./docs/gen_internal_apidoc.sh`.
2271
2272* [major] Add interface attributes to all API calls
2273  This properly documents all API calls with a certain API stability level
2274  such as _committed_ (for stable APIs), _uncommitted_ for APIs which may, but
2275  are not likely to change, and _volatile_ for APIs which are likely to be
2276  changed or removed.
2277
2278* [major] Public header files have been reorganized
2279  This changes the layout of the header files from previous versions. This should
2280  not affect applications as applications should only ever include the main
2281  `<libcouchbase/couchbase.h>` file.
2282
2283  the following files have been _removed_ from the
2284  `<libcouchbase/*>` header directory:
2285
2286    * `types.h` - Merged into other header files
2287    * `arguments.h` - now a part of `couchbase.h`
2288    * `callbacks.h` - now a part of `couchbase.h`
2289    * `debug.h` - unused and obsolete
2290    * `durability.h` - now a part of `couchbase.h`
2291    * `behavior.h` - Merged into `deprecated.h`
2292    * `sanitycheck.h` - Merged into `deprecated.h`
2293    * `timings.h` - Part of `couchbase.h`
2294    * `compat.h` - Part of `deprecated.h`
2295
2296  The following files have been _added_ into the `<libcouchbase/*>` directory.
2297  Unless otherwise noted, these files are included by `<libcouchbase/couchbase.h>`:
2298
2299    * `api3.h` - Volatile proposed 3.0 API. **Not included by default**
2300    * `cxxwrap.h` - Contains the implementation for the deprecated C++ wrappers
2301    * `deprecated.h` - Contains deprecated APIs
2302    * `iops.h` - Contains the IO integration APIs
2303    * `pktfwd.h` - Contains the packet forwarding API. **Not included by default**
2304    * `vbucket.h` - Contains the vBucket mapping API. **Not included by default**
2305
2306* OpenSSL is now a base dependency for the library. This may be disabled at configure
2307  time via `--enable-ssl=no`. See `./configure --help`.
2308
2309* Snappy compression library is bundled and optionally compiled. This is left out by
2310  default as the configure script will search for a system installed `libsnappy`.
2311  Snappy provides the compression feature needed for compressing and inflating data
2312  between client and server. It may be disabled at compile-time via `--enable-snappy=no`
2313
2314* [minor] _libvbucket_ has been fully integrated into libcouchbase from the forked
2315  _libvbucket_ package and, lives fully as part of the
2316  library. The public vBucket API may be found in `<libcouchbase/vbucket.h>`.
2317
2318* [minor] As an alternative to the cross-platform `lcb_uintNN_t` typedefs, a shorter
2319  (and more standards compliant) alternative `lcb_UNN` typedefs are provided, thus
2320  instead of `lcb_uint32_t` you may use `lcb_U32`. The full listing of cross platform
2321  typdefs may be found inside `<libcouchbase/sysdefs.h>`
2322
2323
2324
2325## 2.3.1 (2014-05-08)
2326
2327* [major] CCBC-404: Segfault in `connmgr_invoke_request`
2328  Occasionally a segmentation fault would happen when a connection was being
2329  released as a result of a connection failure. This was because of invalid
2330  list tracking.
2331
2332* [major] CCBC-395: Add `lcb_cntl()` interface for configuration cache
2333  Configuration cache options may be set after instantiation using `lcb_cntl()`
2334  with the new `LCB_CNTL_CONFIGCACHE` operation. The old-style `lcb_create_compat`
2335  creation path is deprecated.
2336
2337* [major] CCBC-394: Get-with-replica occasionally crashes on Windows and UV
2338  during topology changes. This was due to not allocating a buffer if one did
2339  not exist.
2340
2341* [major] CCBC-392: ABI compatibility broken between 2.x and 2.3 for
2342  `lcb_create_compat`. This has been fixed by symbol aliasing between versions.
2343  Developers are recommended to use the `lcb_cntl()` API to set the
2344  configuration cache, as specified in CCBC-395
2345
2346* [major] CCBC-385: Failed assertion on get-with-replica when connection fails.
2347  If a connection fails with a `CMD_GET_REPLICA` command still in the queue an
2348  assertion failure will crash the library. This has been fixed by handling the
2349  opcode in the `failout_single_request` function.
2350
2351* [major] CCBC-384: Unknown Winsock error codes crash application. This was fixed
2352  by providing proper handlers for Winsock codes which were not explicitly
2353  converted into their POSIX equivalents.
2354
2355* [major] CCBC-376: Fix memory leak in configuration parsing. A leak was
2356  introduced in version 2.3.0 by not freeing the JSON pool structure. This has
2357  been fixed in 2.3.1
2358
2359* [minor] CCBC-370: `lcb_get_host` and `lcb_get_port` may return host-port
2360  combinations from different servers. If multiple servers are listening on
2361  different ports this may result in yielding an invalid endpoint by combining
2362  the output from those two functions. This has been fixed in 2.3.1 by returning
2363  the host and port from the first host, in lieu of a currently-connected REST
2364  endpoint.
2365
2366* [minor] CCBC-368: Initial bootstrapping failure may mask `LCB_BUCKET_ENOENT`
2367  calls with `LCB_ETIMEDOUT`. This has been fixed by not retrying configuration
2368  retrieval if an explicit HTTP 404 code is received. Note that when using
2369  bootstrap over memcached, a missing bucket may still be manifest as
2370  `LCB_AUTH_ERROR`.
2371
2372* [minor] CCBC-367: Ensure `lcb_get_host` does not return `NULL` when the
2373  associated `lcb_t` is of `LCB_TYPE_CLUSTER`. This would cause crashes in some
2374  applications which relied on this function to not return `NULL`.
2375
2376* [major] CCBC-389: Fixed Spurious timeouts being delivered in asynchronous
2377  use cases.
2378  In applications which do not use `lcb_wait()` the library will potentially
2379  time out commands internally triggering an erroneous configuration refresh.
2380  While this issue would not end up failing operations it will cause unnecessary
2381  network traffic for retrieving configurations. Applications using `lcb_wait()`
2382  are not affected as that function resets the timeout handler.
2383
2384* [major] CCBC-332, CCBC-364: Compare configuration revision information
2385  for memcached cluster bootstrap. Previously we would refresh the
2386  configuration upon receipt
2387  of any new configuration update from memcached. This is fixed in 2.3.1 where
2388  the configuration will only be applied if it is deemed to be newer than the
2389  current configuration. With memcached bootstrap this is only true if the
2390  configuration's `rev` field is higher than the current one.
2391
2392
2393## 2.3.0 GA (2014-04-07)
2394
2395* [major] CCBC-152: Provide a master-only observe option. This adds a new
2396  struct version to the `lcb_observe_cmd_t` which allows to select only the
2397  master node. One can use this to efficiently check if the key exists (without
2398  retrieving it). It also allows one to get the CAS of the item without fetching
2399  it.
2400
2401* [major] CCBC-281: Fix partial scheduling during multi operations. Previously
2402  the library would deliver spurious callbacks  if multiple operations were
2403  scheduled with a single command and one of the operations could not be mapped
2404  to a server. This fixes this behavior and ensures that callbacks are only
2405  invoked for items if the entire API call succeeded.
2406
2407* [major] CCBC-150: Multi-packet commands will no longer deliver spurious
2408  callbacks on failure. Previously these commands would be relocated to the
2409  same server during a configuration change, resulting in multiple callbacks
2410  for the same command. In this case the client would think all the commands
2411  had been completed, and when the next response arrived it would incorrectly
2412  map it to a different request.
2413
2414* [minor] CCBC-327: Fix assumption of `vbucket_compare()` only returning if
2415  a diff exists. This function actually returns a non-NULL pointer always
2416  unless it cannot allocate more memory. This bug was introduced with the
2417  _DP1_ release.
2418
2419* [minor] CCBC-326: Memcached buckets should use streaming config. This was
2420  left unchecked in the _DP1_ release and has now been fixed.
2421
2422* [major] CCBC-351: Enhance performance for configuration parsing. In previous
2423  versions receiving multiple configurations at once would cause CPU spikes on
2424  slower systems. The configuration parser code has been optimized to alleviate
2425  this issue.
2426
2427* [minor] CCBC-350: Provide `lcb_cntl()` API to retrieve the SCM changeset used
2428  by the currently loaded binary. This is a more effective way to get the
2429  revision as it does not depend on the specific headers the library was
2430  compiled with.
2431
2432* [major] CCBC-340: Correctly parse `""`, `"0"` and `"1"` for environment
2433  variables. In previous versions having the entry set to an empty string
2434  or `0` would still be treated by the library as a true value for various
2435  environment variables. This has been fixed so that clear "False" values
2436  such as the empty string or 0 are treated as such.
2437
2438
2439## 2.3.0-dp1 (2014-02-04)
2440
2441* [major] CCBC-234: Implementation of
2442  [Cluster Configuration Carrier Publication][cccp-wiki]. This is the new and
2443  more efficient way to bootstrap from a cluster using the native memcached
2444  protocol and is quicker than the previous HTTP bootstrap mechanism, dramatically
2445  improving startup times and reducing load on the server. This feature is
2446  available in server verions 2.5 and greater. The existing HTTP configuration is
2447  still supported and will be employed as a fallback in the event that `CCCP`
2448  is not supported.
2449
2450  In conjunction with this, a new struct version has been added to the
2451  `lcb_create_st` parameters structure for use with `lcb_create`. This allows
2452  you to get more control over how the client is initialized:
2453
2454    lcb_t instance;
2455    struct lcb_create_st options;
2456    lcb_config_transport_t enabled_transports = {
2457        LCB_CONFIG_TRANSPORT_CCCP,
2458        LCB_CONFIG_TRANSPORT_LIST_END
2459    };
2460
2461    memset(&options, 0, sizeof(options));
2462    options.version = 2;
2463    options.v.v2.mchosts = "example.com:11210";
2464    options.v.v2.transports = enabled_transports;
2465
2466    lcb_error_t rc = lcb_create(&instance, &options);
2467    if (rc != LCB_SUCCESS) {
2468        fprintf(stderr, "Failed to create instance: %s
2469", lcb_strerror(instance, rc));
2470    }
2471
2472  The above snippet will configure a client to _always_ use the `CCCP` protocol
2473  and never attempt to fall back on HTTP
2474
2475  The CCCP implementation required a significant rewrite in how sockets were
2476  created and re-used. Particularly, a connection pooling feature was implemented.
2477
2478  Additionally, the `cbc` command now has an additional `-C` option which accepts
2479  the preferred configuration mechanism to use.
2480
2481* [major] CCBC-305: Implement logging hooks.
2482
2483  This improvements adds various levels of diagnostic logging with the library
2484  itself. It may be utilized via the environment (by setting the `LCB_LOGLEVEL`
2485  environment variable to a positive integer -- the higher the number the more
2486  verbose the logging).
2487
2488  Integrators may also use the logging API specified in `<libcouchbase/types.h>`
2489  to proxy the library's logging messages into your own application.
2490
2491  Current events logged include connection initialization, destruction, connection
2492  pool management, configuration changes, and timeouts.
2493
2494  By default the library is silent.
2495
2496* [major] CCBC-316: Allow per-node bootstrap/config timeouts.
2497  This change allows more finer grained control over how long to wait per-node
2498  to receive updated configuration info. This setting helps adjust the initial
2499  and subsequent bootstrap processes to help ensure each node gets a slice of
2500  time.
2501
2502* [major] CCBC-297: Handle spurious EWOULDBLOCK on UV/Win32
2503  This issue caused odd errors on Windows when large amounts of data
2504  would be received on the socket.
2505
2506## 2.2.0 (2013-10-05)
2507
2508* [major] CCBC-169 Handle 302 redirects in HTTP (views, administrative
2509  requests). By default the library will follow up to three redirects.
2510  Once the limit reached the request will be terminated with code
2511  `LCB_TOO_MANY_REDIRECTS`. Limit is configurable through
2512  `LCB_CNTL_MAX_REDIRECTS`. If set to -1, it will disable redirect
2513  limit.
2514
2515      int new_value = 5;
2516      lcb_cntl(instance, LCB_CNTL_SET, LCB_CNTL_MAX_REDIRECTS, &new_value);
2517
2518* [major] CCBC-243 Replace isasl with cbsasl, the latter has
2519  implemented both PLAIN and CRAM-MD5 authentication mechanisms.
2520
2521  * `LCB_CNTL_MEMDNODE_INFO` command updated to include effective
2522    SASL mechanism:
2523
2524        cb_cntl_server_t node;
2525        node.version = 1;
2526        node.v.v1.index = 0; /* first node */
2527        lcb_cntl(instance, LCB_CNTL_GET, LCB_CNTL_MEMDNODE_INFO, &node);
2528        if (node.v.v1.sasl_mech) {
2529            printf("authenticated via SASL '%s'
2530",
2531                   node.v.v1.sasl_mech);
2532        }
2533
2534  * It is also possible to force specific authentication mechanism for
2535    the connection handle using `LCB_CNTL_FORCE_SASL_MECH` command:
2536
2537        lcb_cntl(instance, LCB_CNTL_SET, LCB_CNTL_FORCE_SASL_MECH, "PLAIN");
2538
2539* [major] CCBC-286 libuv plugin: use same CRT for free/malloc
2540
2541* [major] CCBC-288 Fail `NOT_MY_VBUCKET` responses on timeout
2542
2543* [major] CCBC-275 Do a full purge when negotiation times out. In this
2544  case we must purge the server from all commands and not simply pop
2545  individual items.
2546
2547* [major] CCBC-275 Reset the server's buffers upon reconnection. This
2548  fixes a crash experienced when requesting a new read with the
2549  previous buffer still in tact. This was exposed by calling
2550  `lcb_failout_server` on a timeout error while maintaining the same
2551  server struct.
2552
2553* [major] CCBC-282 Make server buffers reentrant-safe. When purging
2554  implicit commands, we invoke callbacks which may in turn cause other
2555  LCB entry points to be invoked which can shift the contents and/or
2556  positions of the ringbuffers we're reading from.
2557
2558* [major] CCBC-204, CCBC-205 Stricter/More inspectable behavior for
2559  config cache. This provides a test and an additional `lcb_cntl`
2560  operation to check the status of the configuration cache. Also it
2561  switches off config cache with memcached buckets.
2562
2563      int is_loaded;
2564      lcb_cntl(instance, LCB_CNTL_GET, LCB_CNTL_CONFIG_CACHE_LOADED, &is_loaded);
2565      if (is_loaded) {
2566          printf("Configuration cache saved us a trip to the config server
2567");
2568      } else {
2569          printf("We had to contact the configuration server for some reason
2570");
2571      }
2572
2573* [major] CCBC-278 Use common config retry mechanism for bad
2574  configcache. This uses the same error handling mechanism as when a
2575  bad configuration has been received from the network. New
2576  `LCB_CONFIG_CACHE_INVALID` error code to notify the user of such a
2577  situation
2578
2579* [major] CCBC-274 Handle getl/unl when purging the server (thanks
2580  Robert Groenenberg)
2581
2582* [major] Don't failout all commands on a timeout. Only fail those
2583  commands which are old enough to have timed out already.
2584
2585* [major] CCBC-269 Don't record and use TTP/TTR from observe. Just
2586  poll at a fixed interval, as the responses from the server side can
2587  be unreliable.
2588
2589* [minor] Allow hooks for mapping server codes to errors. This also
2590  helps handle sane behavior if a new error code is introduced, or
2591  allow user-defined logging when a specific error code is received.
2592
2593      lcb_errmap_callback default_callback;
2594
2595      lcb_error_t user_map_error(lcb_t instance, lcb_uint16_t in)
2596      {
2597        if (in == PROTOCOL_BINARY_RESPONSE_ETMPFAIL) {
2598          fprintf(stderr, "temporary failure on server
2599");
2600        }
2601        return default_callback(instance, in);
2602      }
2603
2604      ...
2605
2606      default_callback = lcb_set_errmap_callback(conn, user_map_error);
2607
2608* [minor] Add an example of a connection pool. See
2609  `example/instancepool` directory
2610
2611* [minor] CCBC-279 Force `lcb_wait` return result of wait operation
2612  instead of `lcb_get_last_error`. It returns `last_error` if and only
2613  if the handle is not yet configured
2614
2615* [minor] CCBC-284 `cbc-pillowfight`: compute item size correctly
2616  during set If `minSize` and `maxSize` are set to the same value it
2617  can sometimes crash since it may try to read out of memory bounds
2618  from the allocated data buffer.
2619
2620* [minor] CCBC-283 Apply key prefix CLI option in cbc-pillowfight
2621
2622* [minor] Add `--enable-maintainer-mode`. Maintainer mode enables
2623  `--enable-werror --enable-warnings --enable-debug`, forces all
2624  plugins to be installed and forces all tests, tools, and examples to
2625  be built
2626
2627* [minor] CCBC-255 Expose `LCB_MAX_ERROR` to allow user-defined codes
2628
2629## 2.1.3 (2013-09-10)
2630
2631* [minor] Updated gtest to version 1.7.0. Fixes issue with building
2632  test suite with new XCode 5.0 version being released later this
2633  month.
2634
2635* [major] CCBC-265 Do not try to parse config for `LCB_TYPE_CLUSTER`
2636  handles. It fixes timouts for management operations (like 'cbc
2637  bucket-create', 'cbc bucket-flush', 'cbc bucket-delete' and 'cbc
2638  admin')
2639
2640* [major] CCBC-263 Skip unfinished SASL commands on rebalance. During
2641  rebalance, it is possible that the newly added server doesn't have
2642  chance to finish SASL auth before the cluster will push config
2643  update, in this case packet relocator messing cookies. Also the
2644  patch makes sure that SASL command/cookie isn't mixing with other
2645  commands
2646
2647* [major] Use cluster type connection for cbc-bucket-flush. Although
2648  flush command is accessible for bucket type connections,
2649  cbc-bucket-flush doesn't use provided bucket name to connect to,
2650  therefore it will fail if the bucket name isn't "default".
2651
2652* [major] Allow to make connect order deterministic. It allows the
2653  user to toggle between deterministic and random connect order for
2654  the supplied nodes list. By default it will randomize the list.
2655
2656* [major] Do not allow to use Administrator account for
2657  `LCB_TYPE_BUCKET`
2658
2659* [major] CCBC-258 Fig segmentation faults during tests load of
2660  node.js. Sets `inside_handler` on `socket_connected`. Previously we
2661  were always using SASL auth, and as such, we wouldn't flush packets
2662  from the `cmd_log` using `server_send_packets` (which calls
2663  `apply_want`). `apply_want` shouldn't be called more than once per
2664  event loop entry -- so this sets and unsets the `inside_handler`
2665  flag.
2666
2667* [major] Added support of libuv 0.8
2668
2669* [major] Close config connection before trying next node. It will fix
2670  asserts in case of the config node becomes unresponsive, and the
2671  threshold controlled by `LCB_CNTL_CONFERRTHRESH` and `lcb_cntl(3)`
2672
2673## 2.1.2 (2013-08-27)
2674
2675* [major] CCBC-253, CCBC-254 Use bucket name in SASL if username
2676  omitted. Without this fix, you can may encounter a segmentation
2677  faults for buckets, which are not protected by a password.
2678
2679* [major] Preserve IO cookie in `options_from_info` when using v0
2680  plugins with user-provided IO loop instance. This issue was
2681  introduced in 2.1.0.
2682
2683* [minor] Display the effective IO backend in 'cbc-version'. This is
2684  helpful to quickly detect what is the effective IO plugin on a given
2685  system.
2686
2687## 2.1.1 (2013-08-22)
2688
2689* [minor] Use provided credentials for authenticating to the data
2690  nodes. With this fix, it is no longer possible to use Administrator
2691  credentials with a bucket. If your configuration does so, you must
2692  change the credentials you use before applying this update. No
2693  documentation guides use of Administrator credentials, so this
2694  change is not expected to affect few, if any deployments.
2695
2696* [major] CCBC-239 Do not use socket after failout. Fixes segmentation
2697  faults during rebalance.
2698
2699* [minor] CCBC-245 Distribute debug information with release binaries
2700  on Windows
2701
2702* [minor] CCBC-248 Do not disable config.h on UNIX-like platforms. It
2703  fixes build issue, when application is trying to include plugins
2704  from the tarball.
2705
2706* [major] CCBC-192 Skip misconfigured nodes in the list. New
2707  lcb\_cntl(3couchbase) added to control whether the library will skip
2708  nodes in initial node list, which listen on configuration port (8091
2709  usually) but doesn't meet required parameters (invalid
2710  authentication or missing bucket). By default report this issue and
2711  stop trying nodes from the list, like all previous release. Read
2712  more at man page lcb\_cntl(3couchbase) in section
2713  LCB\_CNTL\_SKIP\_CONFIGURATION\_ERRORS\_ON\_CONNECT
2714
2715* [major] CCBC-246 Fallback to 'select' IO plugin if default plugin
2716   cannot be loaded. On UNIX-like systems, default IO backend is
2717   'libevent', which uses third-party library might be not available
2718   at the run-time. Read in lcb\_cntl(3couchbase) man page in section
2719   LCB\_CNTL\_IOPS\_DEFAULT\_TYPES about how to determine effective IO
2720   plugin, when your code chose to use LCB\_IO\_OPS\_DEFAULT during
2721   connection instantiation. The fallback mode doesn't affect
2722   application which specify IO backend explicitly.
2723
2724## 2.1.0 (2013-08-17)
2725
2726* [major] New backend `select`. This backend is based on the select(2)
2727  system call and its Windows version. It could be considered the most
2728  portable solution and is available with the libcouchbase core.
2729
2730* [major] CCBC-236 New backend `libuv`. This backend previously was
2731  part of the `couchnode` project and is now available as a plugin.
2732  Because libuv doesn't ship binary packages there is no binary
2733  package `libcouchbase2-libuv`. You can build plugin from the source
2734  distribution, or through the `libcouchbase-dev` or
2735  `libcouchbase-devel` package on UNIX like systems.
2736
2737* [major] New backend `iocp`. This is a Windows specific backend,
2738  which uses "I/O Completion Ports". As a part of the change, a new
2739  version of plugin API was introduced which is more optimized to this
2740  model of asynchronous IO.
2741
2742* [major] CCBC-229 Fixed bug when REPLICA\_FIRST fails if first try
2743  does not return key
2744
2745* [major] CCBC-228 Fixed bug when REPLICA\_SELECT didn't invoke
2746  callbacks for negative error codes
2747
2748* [major] CCBC-145 API for durability operations. This new API is
2749  based on `lcb_observe(3)` and allows you to monitor keys more
2750  easily. See the man pages `lcb_durability_poll(3)` and
2751  `lcb_set_durability_callback(3)` for more info.
2752
2753* [major] New configuration interface lcb\_cntl(3) along with new
2754  tunable options of the library and connection instances. In this
2755  release the following settings are available. See the man page for
2756  more information and examples.:
2757
2758  * LCB\_CNTL\_OP\_TIMEOUT operation timeout (default 2.5 seconds)
2759
2760  * LCB\_CNTL\_CONFIGURATION\_TIMEOUT time to fetch cluster
2761    configuration. This is similar to a connection timeout (default 5
2762    seconds)
2763
2764  * LCB\_CNTL\_VIEW\_TIMEOUT timeout for couchbase views (default 75
2765    seconds)
2766
2767  * LCB\_CNTL\_HTTP\_TIMEOUT timeout for other HTTP operations like
2768    RESTful flush, bucket creating etc. (default 75 seconds)
2769
2770  * LCB\_CNTL\_RBUFSIZE size of the internal read buffer (default
2771    32768 bytes)
2772
2773  * LCB\_CNTL\_WBUFSIZE size of the internal write buffer (default
2774    32768 bytes)
2775
2776  * LCB\_CNTL\_HANDLETYPE type of the `lcb\_t` handler (readonly)
2777
2778  * LCB\_CNTL\_VBCONFIG returns pointer to VBUCKET\_CONFIG\_HANDLE
2779    (readonly)
2780
2781  * LCB\_CNTL\_IOPS get the implementation of IO (lcb\_io\_opt\_t)
2782
2783  * LCB\_CNTL\_VBMAP get vBucket ID for a given key
2784
2785  * LCB\_CNTL\_MEMDNODE\_INFO get memcached node info
2786
2787  * LCB\_CNTL\_CONFIGNODE\_INFO get config node info
2788
2789  * LCB\_CNTL\_SYNCMODE control synchronous behaviour (default
2790    LCB\_ASYNCHRONOUS)
2791
2792  * LCB\_CNTL\_IP6POLICY specify IPv4/IPv6 policy (default
2793    LCB\_IPV6\_DISABLED)
2794
2795  * LCB\_CNTL\_CONFERRTHRESH control configuration error threshold
2796    (default 100)
2797
2798  * LCB\_CNTL\_DURABILITY\_TIMEOUT durability timeout (default 5 seconds)
2799
2800  * LCB\_CNTL\_DURABILITY\_INTERVAL durability polling interval (default
2801    100 milliseconds)
2802
2803  * LCB\_CNTL\_IOPS\_DEFAULT\_TYPES get the default IO types
2804
2805  * LCB\_CNTL\_IOPS\_DLOPEN\_DEBUG control verbose printing of dynamic
2806    loading of IO plugins.
2807
2808## 2.0.7 (2013-07-10)
2809
2810* [major] CCBC-183 Improve `lcb_get_replica()`. Now it is possible
2811  to choose between three strategies:
2812
2813  1. `LCB_REPLICA_FIRST`: Previously accessible and now the default,
2814     the caller will get a reply from the first replica to successfully
2815     reply within the timeout for the operation or will receive an
2816     error.
2817
2818  2. `LCB_REPLICA_ALL`: Ask all replicas to send documents/items
2819     back.
2820
2821  3. `LCB_REPLICA_SELECT`: Select one replica by the index in the
2822     configuration starting from zero. This approach can more quickly
2823     receive all possible replies for a given topology, but it can
2824     also generate false negatives.
2825
2826  Note that applications should not assume the order of the
2827  replicas indicates more recent data is at a lower index number.
2828  It is up to the application to determine which version of a
2829  document/item it may wish to use in the case of retrieving data
2830  from a replica.
2831
2832## 2.0.6 (2013-05-07)
2833
2834* [major] CCBC-188 Fix segfault when rebalancing
2835  When a (!connected) server is reconnected, the tasks in its
2836  "pending" buffer will be moved into "output" buffer. If its
2837  connection is broken again immediately, `relocate_packets()` will go
2838  to wrong path.
2839
2840* [major] CCBC-202 Don't try to switch to backup nodes when timeout is
2841  reached
2842
2843* [major] CCBC-188 Check if SASL struct is valid before disposing
2844
2845* [major] Fix compile error with sun studio
2846  "src/event.c", line 172: error: statement not reached (`E_STATEMENT_NOT_REACHED`)
2847
2848* [major] Don't invoke HTTP callbacks after cancellation, because
2849  user code might assume a previously-freed resource is still valid
2850
2851* [minor] CCBC-179 Added an example to properly use the bucket
2852  credentials for authentication instead of administrator credentials
2853
2854* [minor] example/yajl/couchview.c: pass cookie to the command
2855  Fixes coredump when executing ./examples/yajl/couchview
2856
2857* [minor] CCBC-201 Add Host header in http request
2858  http://cbugg.hq.couchbase.com/bug/bug-555 points out that Host is a
2859  required field in HTTP 1.1
2860
2861## 2.0.5 (2013-04-05)
2862
2863* [minor] Try to search the --libdir for modules if dlopen
2864  fails to find the module in the default library path
2865
2866* [minor] CCBC-190 New compat mode (experimental) for configuration
2867  caching. See man `lcb_create_compat()`
2868
2869* [minor] Manpage fixes
2870
2871* [minor] Fix build on FreeBSD (http://review.couchbase.org/25289)
2872
2873* [minor] Fix reconnecting issues on windows
2874  (http://review.couchbase.org/25170 and
2875   http://review.couchbase.org/25155)
2876
2877* [minor] pillowfight example updated to optionally use threads
2878
2879## 2.0.4 (2013-03-06)
2880
2881* [minor] CCBC-185 The bootstrap URI is not parsed correctly
2882
2883* [minor] CCBC-175 Work properly on systems where EWOULDBLOCK != EAGAIN
2884
2885* [critical] CCBC-180 Segmentation fault when the hostname resolved
2886  into several addresses and first of them reject couchbase
2887  connections.
2888
2889* [major] CCBC-182 The library stops iterating backup nodes list if
2890  the next one isn't accessible.
2891
2892* [major] CCBC-147 Fixed illegal memory access in win32 plugin
2893
2894* [minor] CCBC-178 Build error on solaris/sparc: -Werror=cast-align
2895
2896## 2.0.3 (2013-02-06)
2897
2898* [minor] bypass SASL LIST MECH
2899
2900* [minor] Shrink internal lookup tables (and reduce the size of
2901  `lcb_t`)
2902
2903* [minor] Add a new library: `libcouchbase_debug.so` (see
2904  include/libcouchbase/debug.h) which is a new library that contains
2905  new debug functionality.
2906
2907* [minor] Added manual pages for the library
2908
2909* [major] CCBC-153 Reset internal state on `lcb_connect()`. Allow caller
2910  to use `lcb_connect()` multiple times to implement reconnecting using
2911  the same `lcb_t` instance. Also it sets up the initial-connection
2912  timer for users who don't use `lcb_wait()` and drive IO loop manually.
2913
2914* [major] CCBC-171 Invalid read in libevent plugin, when the plugin
2915  compiled in 1.x mode
2916
2917* [critical] CCBC-155 Observe malfunctions in the case of multiple
2918  keys and server failure
2919
2920* [major] CCBC-156 The ep-engine renders meaningful body for observe
2921  responses only if status code is 0 (`PROTOCOL_BINARY_RESPONSE_SUCCESS`).
2922  We shouldn't interpret response body in other cases, just decode &
2923  failout request instead. Also we shouldn't retry observe commands on
2924  `PROTOCOL_BINARY_RESPONSE_NOT_MY_VBUCKET`, because it can cause the
2925  client to loop infinitely
2926
2927* [major] CCBC-145 KV Durability operation API. Async APIs added to
2928  allow the checking of the durability (replication and persistence)
2929  status of a key, and to notify the user when a specific criteria has
2930  been satisfied.
2931
2932## 2.0.2 (2013-01-04)
2933
2934* [major] CCBC-150 commands sent to multiple servers fail to detect
2935  the respose if mixed with other commands.
2936
2937* [minor] CCBC-143 'cbc version' reports that uses 2.0.0, but really
2938  installed with 2.0.1. Minor but confusing issue.
2939
2940* [major] CCBC-151 Cancellation of the HTTP request might lead to
2941  memory leaks or to segfaults (2e3875c2).
2942
2943* [minor] Document `LCB_SERVER_BUG` and `LCB_PLUGIN_VERSION_MISMATCH`.
2944  Enhance the the `lcb_strerror()` test to detect undocumented error
2945  codes.
2946
2947* [critical] CCBC-153 Under high load the library could generate
2948  `LCB_ETIMEDOUT` errors without reason owing to internal limitations.
2949
2950## 2.0.1 (2012-12-11)
2951
295250 files changed, 1009 insertions(+), 274 deletions(-)
2953
2954* libev-plugin: delay all timers while the loop isn't active. It will
2955  fix `LCB_ETIMEOUT` in the following scenario:
2956
2957  * connect the instance
2958  * sleep for time greater than default timeout (e.g. 3 seconds)
2959  * schedule and execute a command (it will be timed out
2960    immediately)
2961
2962* libev-plugin: reset IO event on delete. We need to reset it,
2963  because it might be re-used later
2964
2965* CCBC-136: do not abort when purging SASL commands
2966
2967* Make library C89 friendly again
2968
2969* CCBC-132, CCBC-133: Ensure HTTP works even when the network may be
2970  unreliable. This changeset encompasses several issues which had been
2971  found with HTTP requests during network errors and configuration
2972  changes. Specifically some duplicate code paths were removed, and
2973  the process for delivering an HTTP response back to the user is more
2974  streamlined.
2975
2976* CCBC-130: Fix a memory leak on the use of http headers
2977
2978* CCBC-131: Compensate for cluster nodes lacking couchApiBase
2979
2980* Fix possible SEGFAULT. Not-periodic timers are destroyed after
2981  calling user's callback, after that library performed read from
2982  freed pointer.
2983
2984* SystemTap and DTrace integration
2985
2986## 2.0.0 (2012-11-27)
2987
298812 files changed, 50 insertions(+), 12 deletions(-)
2989
2990* Install unlock callback in synchronous mode
2991
2992* Add the CAS to the delete callback
2993
2994* Minor update of the packaging layout:
2995
2996  * libcouchbase-all package comes without version
2997  * extract debug symbols from libcouchbase-{bin,core} to
2998    libcouchbase-dbg package
2999
3000## 2.0.0beta3 (2012-11-21)
3001
300264 files changed, 3641 insertions(+), 735 deletions(-)
3003
3004* CCBC-104 Fix illegal memory access. Reconnect config listener if the
3005  config connection was gone without proper shutdown.
3006
3007* Check for EWOULDBLOCK/EINTR on failed send
3008
3009* Allow to use gethrtime() from C++
3010
3011* Fix using freed memory (was introduced in 4397181)
3012
3013* Use dynamic versioning for plugins
3014
3015* Remove libtool version from the plugins
3016
3017* Allow to use 'cbc-hash' with files
3018
3019* CCBC-120 Purge stale OBSERVE packets
3020
3021* CCBC-120 Reformat and refactor `lcb_server_purge_implicit_responses`:
3022
3023  * move packet allocation out of GET handler
3024  * dropping NOOP command shouldn't return error code
3025
3026* CCBC-122 Try to switch another server from backup list on timeout
3027
3028* CCBC-119: Allow the user to specify a different hash key. All of the
3029  data operations contains a hashkey and nhashkey field. This allows
3030  you to "group" items together in your cluster. A typical use case
3031  for this is if you're storing lets say data for a single user in
3032  multiple objects. If you want to ensure that either all or none of
3033  the objects are available if a server goes down, it could be a good
3034  idea to locate them on the same server. Do bear in mind that if you
3035  do try to decide where objects is located, you may end up with an
3036  uneven distribution of the number of items on each node. This will
3037  again result in some nodes being more busy than others etc. This is
3038  why some clients doesn't allow you to do this, so bear in mind that
3039  by doing so you might not be able to get your objects from other
3040  clients.
3041
3042* Create man pages for cbc and cbcrc
3043
3044* CCBC-118 `lcb_error_t` member in the http callbacks shouldn't reflect
3045  the HTTP response code. So the error code will be always `LCB_SUCCESS`
3046  if the library managed to receive the data successfully.
3047
3048* Timer in libev uses double for interval. Ref:
3049  [](http://pod.tst.eu/http://cvs.schmorp.de/libev/ev.pod#code_ev_timer_code_relative_and_opti)
3050
3051* CCBC-115 Return zero from `do_read_data()` if `operations_per_call`
3052  reached. The `operations_per_call' limit was introduced to prevent
3053  from freezing event loop. But in the function variable rv could
3054  store two different results and in case of reaching this limit it is
3055  returning number of the processed records, which is wrong. The
3056  function should return either zero (success) or non-zero (failure).
3057
3058* Do not allow admin operations without authentication
3059
3060* Fix cbc-bucket-create. `sasl-password' is misspelled, and it fails
3061  to parse the command line option.
3062
3063* CCBC-114 Lookup the plugin symbol also in the current executable
3064  image.
3065
3066* CCBC-113 Remove unauthorized asserion (d344037). The
3067  `lcb_server_send_packets()` function later check if the server object
3068  connected and establish connection if not (with raising possible
3069  errors)
3070
3071* Try all known plugins for `LCB_IO_OPS_DEFAULT` in run time
3072
3073* Don't use the `time_t` for win32. When compiling from php it turns out
3074  that it gets another size of the `time_t` type, causing the struct
3075  offsets to differ.
3076
3077* Add `lcb_verify_compiler_setup()`. This function allows the "user" of
3078  the library to verify that the compiler use a compatible struct
3079  packing scheme.
3080
3081* CCBC-87: Add documentation about the error codes
3082
3083## 2.0.0beta2 (2012-10-12)
3084
308581 files changed, 2822 insertions(+), 1353 deletions(-)
3086
3087* Search ev.h also in ${includedir}/libev
3088
3089* Fix SEGFAULT if IO struct is allocated not by the `lcb_create()`
3090
3091* Allow libcouchbase to connect to an instance without specifying bucket. It is useful
3092  when the bucket not needed, e.g. when performing administration
3093  tasks.
3094
3095* Fix memory leak after an unsuccessful connection
3096
3097* Fix invalid memory access in cbc tool. Affected command is
3098  cbc-bucket-create
3099
3100* `lcb_create`: replace `assert()` with error code
3101
3102* CCBC-105 breakout event loop in default `error_callback`. This provides
3103  better default behaviour for users who haven't defined global error
3104  callback.
3105
3106* Allow users to build the library without dependencies. For example,
3107  without plugins at all. This may be useful if the plugin is
3108  implemented by or built into the host application.
3109
3110* Allow users to install both libraries (2.x and 1.x) on the same system.
3111
3112* Make the content type optional for `lcb_make_http_request()`
3113
3114* Fix password memory leak in http.c (7e71493)
3115
3116* Add support for raw http requests. libcouchase already contains all
3117  the bits to execute a raw http request, except for the possibility
3118  to specify a host:port, username and password.
3119
3120* Cleanup HTTP callbacks. Use the same callbacks both for Management
3121  and View commands, and rename them to `lcb_http_complete_callback` and
3122  `lcb_http_data_callback`.
3123
3124* Allow users to use environment variables to pick the event plugin
3125
3126* Add a new interface version for creating IO objects via plugins
3127
3128* Implement a new libev plugin. It is compatible with both libev3 and
3129  libev4.
3130
3131* CCBC-103: Fix linked event/timer lists for win32
3132
3133* Allow to disable CXX targets
3134
3135* `lcb_connect()` should honor the syncmode setting. Automatically call
3136  `lcb_wait()` when in synchronous mode
3137
3138## 2.0.0beta (2012-09-13)
3139
3140123 files changed, 13753 insertions(+), 8264 deletions(-)
3141
3142* Refactor the API. This is a full redesign of the current
3143  libcouchbase API that'll allow us to extend parts of the API without
3144  breaking binary compatibility. Also it renames all functions to have
3145  `lcb_` prefix instead of `libcouchbase_` and `LCB`/`LIBCOUCHBASE` in macros.
3146
3147* Added --enable-fat-binary. Helps to solve issues when linking with
3148  fat binaries on MacOS.
3149
3150* Implement getter for number of nodes in the cluster:
3151  `lcb_get_num_nodes()`
3152
3153* Implement RESTful flush in the cbc toolset
3154
3155* Bundle Windows packages as zip archives
3156
3157* CCBC-98 Differentiate between TMPFAILs. This allows a developer
3158  to know if the temporary condition where the request cannot be
3159  handled is due to a constraint on the client or the server.
3160
3161* Don't try to put the current node last in the backup list. This may
3162  cause "duplicates" in the list if the REST server returns another
3163  name for the server than you used.  Ex: you specify "localhost" and
3164  the REST response contains 127.0.0.1
3165
3166* Fix locking keys in multi-get mode
3167
3168* Fix bug where HTTP method is not set
3169
3170* CCBC-96 Correct buffer length for POST/PUT headers
3171
3172* Add `lcb_get_server_list`
3173
3174* Merge `lcb_get_locked` into `lcb_get` function
3175
3176* Fix Windows build
3177
3178* Include sys/uio.h. Needed by OpenBSD
3179
3180* Fix mingw build (c394a1c)
3181
3182* CCBC-80: Default to IPv4 only
3183
3184* Sync `memcached/protocol_binary.h`. Pull extra
3185  `protocol_binary_datatypes` declarations.
3186
3187* Deliver HTTP headers via callbacks
3188
3189* Unify HTTP interface. This means massive rename of the symbols
3190
3191* CCBC-92 release ringbuffer in `lcb_purge_single_server`
3192
3193* CCBC-91 Fix switching to backup node in case of server outage
3194
3195* CCBC-91 Reset timer for commands with `NOT_MY_VBUCKET` response
3196
3197* Fix alignment for sparc platforms
3198
3199* Fix win32 build (Add strings.h)
3200
3201* Fix build with libyajl available
3202
3203* Bundle libvbucket
3204
3205* Fix a problem with allocating too few slots in the `backup_nodes`. Fixes
3206  illegal memory access.
3207
3208* CCBC-90 Fix initialization of backup nodes array. The code switching
3209  nodes relies on NULL terminator rather than `nbackup_nodes` variable.
3210  Fixes illegal memory access.
3211
3212* CCBC-89: Release the memory allocated by the http parser
3213
3214## 1.0.6 (2012-08-30)
3215
32165 files changed, 18 insertions(+), 5 deletions(-)
3217
3218* CCBC-92 release ringbuffer in `libcouchbase_purge_single_server`
3219
3220## 1.0.5 (2012-08-15)
3221
32226 files changed, 23 insertions(+), 15 deletions(-)
3223
3224* CCBC-91 Fix switching to backup node in case of server outage
3225
3226* CCBC-91 Reset timer for commands with `NOT_MY_VBUCKET` response
3227
3228## 1.1.0dp9 (2012-07-27)
3229
32305 files changed, 18 insertions(+), 11 deletions(-)
3231
3232* Render auth credentials for View requests.
3233  `libcouchbase_make_http_request()` won't accept credentials anymore.
3234  It will pick them bucket configuration.
3235
3236## 1.1.0dp8 (2012-07-27)
3237
323836 files changed, 2093 insertions(+), 704 deletions(-)
3239
3240* Allow the client to specify the verbosity level on the servers using
3241  `lcb_set_verbosity()` function.
3242
3243* Bind timeouts to server sockets instead of commands. This means that
3244  from this point timeout interval will be started from the latest IO
3245  activity on the socket. This is a behavior change from the 1.0 series.
3246
3247* Allow the user to get the number of replicas using
3248  `libcouchbase_get_num_replicas()`
3249
3250* Allow a user to breakout from the event loop in callbacks using
3251  `libcouchbase_breakout()`
3252
3253* Make `libcouchbase_wait()` re-entrable
3254
3255* Let users detect if the event loop running already using
3256  `libcouchbase_is_waiting()` function.
3257
3258* CCBC-77 Use separate error code for ENOMEM on the client
3259
3260* CCBC-82 Implement read replica
3261
3262* CCBC-85 Implement general purpose timers. It is possible for users
3263  to define their own timers using `libcouchbase_timer_create()`
3264  function. (See headers for more info)
3265
3266* Implement multiple timers for windows
3267
3268* CCBC-15 Add OBSERVE command
3269
3270* Allow users to specify content type for HTTP request
3271
3272* Fix to handle the case when View base doesn't have URI schema
3273
3274* Separate HTTP callbacks for couch and management requests
3275
3276* Claim that server has data in buffers if there are HTTP requests
3277  pending. Without this patch the event loop can be stopped
3278  prematurely.
3279
3280* Add new cbc commands and options:
3281
3282  * cbc-view (remove couchview example)
3283  * cbc-verbosity
3284  * cbc-admin
3285  * cbc-bucket-delete
3286  * cbc-bucket-create
3287  * Add -p and -r options to cbc-cp to control persistence (uses
3288    OBSERVE internally)
3289
3290## 1.1.0dp7 (2012-06-19)
3291
329218 files changed, 266 insertions(+), 115 deletions(-)
3293
3294* Add support for notification callbacks for configuration changes.
3295  Now it is possible to install a hook using function
3296  `libcouchbase_set_configuration_callback()`, and be notified about all
3297  configuration changes.
3298
3299* Implement function to execution management requests. Using
3300  `libcouchbase_make_management_request()` function you can configure
3301  the cluster, add/remove buckets, rebalance etc. It behaves like
3302  `libcouchbase_make_couch_request()` but works with another endpoint.
3303
3304* Extract HTTP client. Backward incompatible change in Couchbase View
3305  subsystem
3306
3307## 1.1.0dp6 (2012-06-13)
3308
330920 files changed, 201 insertions(+), 127 deletions(-)
3310
3311* CCBC-70 Close dynamic libraries. Fixes small memory leak
3312
3313* CCBC-72 Fix compilation on macosx with gtest from homebrew
3314
3315* CCBC-71 Implement 'help' command for cbc tool
3316
3317* Undefine NDEBUG to avoid asserts to be optimized out
3318
3319* Fix win32 builds:
3320
3321  * Add suffix to cbc command implementations
3322  * Fix guards for socket errno macros
3323  * Define `size_t` types to fix MSVC 9 build
3324  * MSVC 9 isn't C99, but has stddef.h, so just include it
3325
3326* CCBC-63 Include types definitions for POSIX systems. Fixes C++
3327  builds on some systems.
3328
3329## 1.1.0dp5 (2012-06-06)
3330
33317 files changed, 65 insertions(+), 9 deletions(-)
3332
3333* The library doesn't depend on pthreads (eliminates package lint
3334  warnings)
3335
3336* Implement 'cbc-hash' to match server/vbucket for given key
3337
3338## 1.1.0dp4 (2012-06-05)
3339
33408 files changed, 54 insertions(+), 7 deletions(-)
3341
3342* cbc: strtoull doesn't exist on win32, therefore use C++ equivalent.
3343
3344* integration with Travis-CI
3345
3346## 1.1.0dp3 (2012-06-03)
3347
334854 files changed, 1874 insertions(+), 824 deletions(-)
3349
3350* CCBC-68 Implement `UNLOCK_KEY` (`UNL`) command
3351
3352* CCBC-68 Implement `GET_LOCKED` (`GETL`) command
3353
3354* hashset.c: iterate over whole set on rehashing. Fixes memory leaks
3355  related to hash collisions (905ef95)
3356
3357* Destroy view requests items when server get destroyed
3358
3359* Do not call View callbacks for cancelled requests
3360
3361* Fix `ringbuffer_memcpy()` (36afdb2)
3362
3363* CCBC-62 A hang could occur in `libcouchbase_wait()` after the timeout
3364  period. Check for breakout condition after purging servers
3365
3366* CCBC-65 A small memory leak can occur with frequent calls to
3367  `libcouchbase_create()` and `libcouchbase_destroy()`
3368
3369* CCBC-64. Timeouts can occur during topology changes, rather than be
3370  correctly retried. Send the retry-packet to new server
3371
3372* `vbucket_found_incorrect_master()` returns server index
3373
3374* Fix `ringbuffer_is_continous()`
3375
3376* Pick up cookies from pending buffer unless node connected
3377
3378* RCBC-33 A fix for a buffer overflow with the supplied password as
3379  has been integrated. While it is a buffer overflow issue, this is
3380  not considered to be a possible security issue because the password
3381  to the bucket is not commonly supplied by an untrusted source
3382
3383## 1.0.4 (2012-06-01)
3384
338515 files changed, 330 insertions(+), 76 deletions(-)
3386
3387* CCBC-65 A small memory leak can occur with frequent calls to
3388  `libcouchbase_create()` and `libcouchbase_destroy()`
3389
3390* CCBC-62 A hang could occur in `libcouchbase_wait()` after the timeout
3391  period. Check for breakout condition after purging servers
3392
3393* CCBC-64. Timeouts can occur during topology changes, rather than be
3394  correctly retried. Send the retry-packet to new server
3395
3396* [backport] `vbucket_found_incorrect_master()` returns server index.
3397  (orig: c32fdae)
3398
3399## 1.0.3 (2012-05-02)
3400
34016 files changed, 44 insertions(+), 7 deletions(-)
3402
3403* [backport] Fix `ringbuffer_is_continous()` (orig: 9cfda9d)
3404
3405* [backport] Pick up cookies from pending buffer unless node connected
3406  (orig: 463958d)
3407
3408* RCBC-33 A fix for a buffer overflow with the supplied password as
3409  has been integrated. While it is a buffer overflow issue, this is
3410  not considered to be a possible security issue because the password
3411  to the bucket is not commonly supplied by an untrusted source
3412
3413## 1.1.0dp2 (2012-04-10)
3414
341510 files changed, 54 insertions(+), 20 deletions(-)
3416
3417* CCBC-59 Don't wait for empty buffers. If called with no operations
3418  queued, `libcouchbase_wait()` will block forever. This means that a
3419  single threaded application that calls `libcouchbase_wait()` at
3420  different times to make sure operations are sent to the server runs
3421  the risk of stalling indefinitely. This is a very likely scenario.
3422
3423* Don't define `size_t` and `ssize_t` for VS2008
3424
3425* Fix segfault while authorizing on protected buckets (211bb04)
3426
3427## 1.1.0dp (2012-04-05)
3428
342959 files changed, 4374 insertions(+), 1205 deletions(-)
3430
3431* This release adds new functionality to directly access Couchbase
3432  Server views using the `libcouchbase_make_couch_request()` function.
3433  See the associated documentation and header files for more details
3434
3435* Check for newer libvbucket
3436
3437* MB-4834: Request the tap bytes in a known byte order (adf2b30)
3438
3439## 1.0.2 (2012-03-06)
3440
344183 files changed, 4095 insertions(+), 654 deletions(-)
3442
3443* Implement VERSION command from binary protocol
3444
3445* Allow use of libcouchbase to pure memcached clusters by using
3446  `libcouchbase_create_compat()` function
3447
3448* Always sign deb packages and allow to pass PGP key
3449
3450* Bundle the protocol definitions for memcached
3451  (`memcached/protocol_binary.h` and `memcached/vbucket.h`) to make it
3452  easier to build
3453
3454* Bundle sasl client implementation
3455
3456* Fix windows build for MS Visual Studio 9
3457
3458  * define `E*` if missing
3459  * stdint header
3460
3461* Add support for multiple hosts for the bootstrap URL. A list of
3462  hosts:port separated by ';' to the administration port of the
3463  couchbase cluster. (ex: "host1;host2:9000;host3" would try to
3464  connect to host1 on port 8091, if that fails it'll connect to host2
3465  on port 9000 etc)
3466
3467* Raise error if <stdint.h> missing
3468
3469* Add JSON support for cbc-cp command
3470
3471* Add option to set timeout for cbc
3472
3473* Added support for '-' to cp
3474
3475* Added cbc-verify: verify content in cache with files
3476
3477* Now cbc supports better usage messages
3478
3479## 1.0.1 (2012-02-13)
3480
348165 files changed, 3275 insertions(+), 1329 deletions(-)
3482
3483* CCBC-38 Use alternate nodes when current is dead. A fix to allow the
3484  client library to failover automatically to other nodes when the
3485  initial bootstrap node becomes unavailable has been added. All users
3486  are recommended to upgrade for this fix.
3487
3488* Fix connect timeouts. Timeouts are per-operation and only set if
3489  there is any I/O. The special exception to this is initial
3490  connections, which do not necessarily have a data stream or write
3491  buffer associated wiht them yet.
3492
3493* Update to new MT-safe libvbucket API
3494
3495* Add option for embedding libevent IO plugin
3496
3497* Fix multi-{get,touch} requests handling when nkeys > 1
3498
3499* Allow to build without tools which require C++ compiler
3500
3501* Destroy event base if we created it
3502
3503* CCBC-51 Check server index before using
3504
3505* Handle `PROTOCOL_BINARY_RESPONSE_NOT_MY_VBUCKET` and retry it until
3506  success or another error, which can be handled by caller
3507
3508* Do not attempt SASL when SASL already in progress
3509
3510* Finer grained error reporting for basic REST errors:
3511
3512  * return `LIBCOUCHBASE_AUTH_ERROR` on HTTP 401
3513  * return `LIBCOUCHBASE_BUCKET_ENOENT` on HTTP 404
3514  * event loop is stopped (via `maybe_breakout`) on REST error
3515
3516* Fixed segfaults and memory access errors on libevent1.4
3517
3518* Allow for notification on initial vbucket config. This makes
3519  libcouchbase `stop_event_loop` and libcouchbase maybe breakout work
3520  properly in cooperative asynchronous event loops. the wait flag is
3521  set by `libcouchbase_wait()` and unset by `maybe_breakout`.
3522  Additionally, `breakout_vbucket_state_listener` will call
3523  `maybe_breakout` as well, instead of having synchronous behavior
3524  assumed by `libcouchbase_wait()`
3525
3526* Fix `sasl_list_mech_response_handler()`. `sasl_client_start()` expects
3527  null-terminated string
3528
3529* Refactor: use `libcouchbase_xxxx` for the datatypes
3530
3531* Do not notify user about the same error twice. Use command callback
3532  when it's possible. (e.g. where the `libcouchbase_server_t` is
3533  accessible and we can `libcouchbase_failout_server()`)
3534
3535* Install configuration.h for win32
3536
3537* CCBC-20 Implement operation timeouts. Timeouts applies for all
3538  operations, and the timer starts running from the moment you call
3539  the libcouchbase operation you want. The timer includes times for
3540  connect/send/ receive, and all of the time our application spend
3541  before letting the event loop call callbacks into libcouchbase.
3542
3543* Fix double free() error when reading key from packet in handler.c
3544  (b5d485a)
3545
3546## 1.0.0 (2012-01-22)
3547
3548170 files changed, 6048 insertions(+), 7553 deletions(-)
3549
3550* Allow the user to specify sync mode on an instance
3551
3552* Empty string as bucket name should be treated as NULL
3553
3554* Bail out if you can't find memcached/vbucket.h and
3555  libvbucket/vbucket.h
3556
3557* New command cbc. This command intended as the analog of `mem*`
3558  tools from libmemcached distribution. Supported commands:
3559
3560  * cbc-cat
3561  * cbc-cp
3562  * cbc-create
3563  * cbc-flush
3564  * cbc-rm
3565  * cbc-stats
3566  * cbc-send
3567  * cbc-receive
3568
3569* CCBC-37 allow config for cbc tool to be read from .cbcrc
3570
3571* Convert flags to network byte order
3572
3573* Remove <memcached/vbucket.h> dependency
3574
3575* Use the error handler instead of printing to stderr
3576
3577* Disable Views code
3578
3579* Don't accept NULL as a valid "callback"
3580
3581* Add make targets to build RPM and DEB packages
3582
3583* Allow download memcached headers from remote host
3584
3585* Added docbook-based manual pages
3586
3587* Gracefully update vbucket configuration. This means that the
3588  connection listener, could reconfigure data sockets on the fly
3589
3590* Allow libcouchbase build with libevent 1.x (verified for 1.4.14)
3591
3592* Aggregate flush responses
3593
3594* Add stats command
3595
3596## 0.3.0 (2011-11-02)
3597
3598102 files changed, 6188 insertions(+), 1531 deletions(-)
3599
3600* Add flush command from binary protocol
3601
3602* Remove packet filter
3603
3604* Use ringbuffers instead `buffer_t`
3605
3606* Win32 build fixes
3607
3608* Allow to specify IO framework but using IO plugins
3609
3610* CCBC-11 The interface to access views
3611
3612* Initial man pages
3613
3614* Extend the test suite
3615
3616## 0.2.0 (2011-09-01)
3617
361885 files changed, 12144 insertions(+)
3619
3620* Simple bootstapping which builds HTTP packet and listens
3621  /pools/default/buckets/BUCKETNAME directly. Allowed usage of
3622  defaults (bucket name, password)
3623
3624* Support basic set of binary protocol commands:
3625
3626  * get (get and touch)
3627  * set
3628  * increment/decrement
3629  * remove
3630  * touch
3631
3632* MB-3294 Added `_by_key` functions
3633
3634* CCBC-5 Fixed abort in `do_read_data` (c=0x7b09bf0) at src/event.c:105
3635
3636* Added timings API. It might be possible to turn on timing collection
3637  using `libcouchbase_enable_timings()`/`libcouchbase_disable_timings()`,
3638  and receive the data in timings callback.
3639
3640* Basic TAP protocol implementation
3641
3642* Initial win32 support
3643