/
libcouchbase.spec.in
1805 lines (1537 loc) · 71.9 KB
/
libcouchbase.spec.in
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
Summary: Couchbase Client & Protocol Library
Name: libcouchbase
Version: @VERSION@
Release: @RELEASE@%{?dist}
Vendor: Couchbase, Inc.
Packager: Couchbase SDK Team <support@couchbase.com>
License: Apache-2
Group: System Environment/Libraries
BuildRequires: libevent-devel >= 1.4, libev-devel >= 3, openssl-devel
URL: https://github.com/couchbase/libcouchbase
Source: @TARREDAS@.tar.gz
BuildRoot: %{_topdir}/build/@TARREDAS@
%description
This is the client and protocol library for Couchbase project.
%package -n %{name}2-libevent
Group: System Environment/Libraries
Summary: Couchbase Client & Protocol Library (libevent backend)
Requires: %{name}2-core = %{version}-%{release}, libevent >= 1.4
%description -n %{name}2-libevent
This package provides libevent backend for libcouchbase
%package -n %{name}2-libev
Group: System Environment/Libraries
Summary: Couchbase Client & Protocol Library (libev backend)
Requires: %{name}2-core = %{version}-%{release}, libev >= 3
%description -n %{name}2-libev
This package provides libev backend for libcouchbase
%package -n %{name}2-core
Group: System Environment/Libraries
Summary: Couchbase Client & Protocol Library (core)
Provides: %{name}2
%description -n %{name}2-core
This package provides the core for libcouchbase. It contains an IO
implementation based on select(2). If preferred, you can install one
of the available backends (libcouchbase2-libevent or
libcouchbase2-libev). libcouchbase will automatically use the
installed backend. It is also possible to integrate another IO backend
or write your own.
%package -n %{name}2-bin
Group: Development/Tools
Summary: Couchbase Client Tools
Requires: %{name}2-core = %{version}-%{release}
%description -n %{name}2-bin
This is the CLI tools Couchbase project.
%package devel
Group: Development/Libraries
Summary: Couchbase Client & Protocol Library - Header files
Requires: %{name}2-core = %{version}-%{release}
%description devel
Development files for the Couchbase Client & Protocol Library
%prep
%setup -q -n @TARREDAS@
%configure --disable-couchbasemock --disable-tests --disable-libuv
%build
%{__make} %{_smp_mflags}
%install
%{__make} install DESTDIR="%{buildroot}" AM_INSTALL_PROGRAM_FLAGS=""
%clean
%{__rm} -rf %{buildroot}
%post -n %{name}2-core -p /sbin/ldconfig
%postun -n %{name}2-core -p /sbin/ldconfig
%files -n %{name}2-core
%defattr(-, root, root)
%{_libdir}/libcouchbase.la
%{_libdir}/libcouchbase.so.*
%files -n %{name}2-libevent
%defattr(-, root, root)
%{_libdir}/libcouchbase_libevent.la
%{_libdir}/libcouchbase_libevent.so
%files -n %{name}2-libev
%defattr(-, root, root)
%{_libdir}/libcouchbase_libev.la
%{_libdir}/libcouchbase_libev.so
%files -n %{name}2-bin
%defattr(-, root, root)
%{_bindir}/cbc*
%{_mandir}/man1/cbc*.1*
%{_mandir}/man4/cbcrc*.4*
%files devel
%defattr(-, root, root)
%doc README.markdown AUTHORS LICENSE RELEASE_NOTES.markdown
%{_includedir}/libcouchbase
%{_libdir}/libcouchbase.so
%changelog
* Tue Aug 26 2014 Mark Nunberg <mark.nunberg@couchbase.com> - 2.4.1-1
- Implement `mcflush` subcommand for `cbc`. This was removed in the cbc
rewrite as the previous `flush` command.
* Priority: Minor
* Issues: [CCBC-486](http://couchbase.com/issues/browse/CCBC-486)
- Requests issued to an invalid replica via `lcb_get_replica()` should fail
with the `LCB_NO_MATCHING_SERVER_CODE`. Previously this sometimes went
through due to an incorrect bounds checking in the `lcbvb_vbreplica()`
function.
* Priority: Major
* Issues: [CCBC-488](http://couchbase.com/issues/browse/CCBC-488)
- Fixed a memory leak in `lcb_get_replica()` when the operation would fail.
* Priority: Major
* Issues: [CCBC-489](http://couchbase.com/issues/browse/CCBC-489)
[CCBC-490](http://couchbase.com/issues/browse/CCBC-490)
- Fix memory leak in `lcb_sched_fail()` when extended commands are in the
pipeline
* Priority: Major
* Issues: [CCBC-474](http://couchbase.com/issues/browse/CCBC-474)
- Provide `lcb_dump()` function call to dump state information about
a client handle. The function call itself is currently marked as
volatile and the output format is very much likely to change.
* Priority: Minor
* Issues: [CCBC-491](http://couchbase.com/issues/browse/CCBC-490)
- Fix `ratio` argument in `cbc-pillowfight`. This ensures that the
`ratio` argument will truly determine the ratio of gets to sets.
* Priority: Minor
- Fix crash when HTTP request is retried. This may take place during topology
changes
* Priority: Major
* Issues: [CCBC-497](http://couchbase.com/issues/browse/CCBC-497)
* Tue Jul 29 2014 Mark Nunberg <mark.nunberg@couchbase.com> - 2.4.0-1
- [major] Attempt to retry items that are mapped to a non-existent node in
a degraded cluster. Rather than returning `LCB_NO_MATCHING_SERVER` the
behavior should be to wait for the item to succeed and attempt to fetch
a new cluster configuration.
In order to control how such 'orphaned' commands are handled, a new value
has been added to the `lcb_RETRYMODEOPTS` called `LCB_RETRY_ON_MISSINGNODE`
which dictates how commands should be rescheduled if the associated vbucket
has no master. The default is to retry the command until it times out, but
by setting this value to `0` (See `LCB_CNTL_RETRYMODE`) it may only be
attempted once, causing 'fail fast' behavior in such a case.
- [major] Don't throttle config requests based on initial file-based config.
This allows the client to quickly recover from a stale config cache without
waiting for the `LCB_CNTL_CONFDELAY_THRESH` interval to elapse. Prior to this
fix, a client would appear to "not recover" if bootstrapping from a stale cache.
In reality the client would eventually recover but was waiting for the delay
threshold to elapse.
- [major] Ignore `NOT_MY_VBUCKET` config payloads if CCCP provider is disabled.
This allows the client to circumvent any possible bugs in the CCCP response
payload and rely entirely on the HTTP config. It also allows 'rewriting'
proxies like confsed to function.
* Fri Jul 11 2014 Mark Nunberg <mark.nunberg@couchbase.com> - 2.4.0-0.beta
- [minor] Communication via legacy memcached servers is possible
by using the `memcached://` scheme in the connection string.
- [minor] Environment variables understood by the library are now
documented in their own section.
- [major] Add `lcb_get_node()` function to retrieve addresses for
various nodes in the cluster. This deprecates the `lcb_get_host()`,
`lcb_get_port()` and `lcb_get_server_list()` functions as they are
constrained to only return information about the administrative API.
The new function is configurable to return information about various
ports.
- [major] The `dsn` field in the `lcb_create_st` structure has been
renamed to `connstr`.
- [major] An HTTP request which has followed redirects will cause the
`lcb_wait()` function to never return. This bug was introduced in
2.4.0-DP1 and has now been fixed.
- [minor] `lcb_get_server_list()` function now returns updated information
from the current cluster configuration. Previously this would only return
a node from the list specified during initial creation.
- [minor] Provide additional error classifiers. Two error classifiers have
been added, they are:
* `LCB_ERRTYPE_SRVLOAD` which indicates that the server is likely under high load.
* `LCB_ERRTYPE_SRVGEN` which indicates that the error is a direct reply from the
server. This code can help distinguish between client and server generated
return codes.
- [major] Provide HTTP keepalive and connection pooling for HTTP requests.
This allows the client to reuse an HTTP connection for multiple requests
rather than creating a new connection and closing it for each operation.
The functionality may be controlled via the `LCB_CNTL_HTTP_POOLSIZE` setting
which limits how many open connections (per server) to maintain inside the
client. Setting this value to `0` will disable pooling and restore old
behavior.
- [major] Properly schedule next invocations for retry queue. A bug was introduced
in 2.4.0-dp1 which would cause the next tick callback to be invoked in what is
effectively a busy loop. This would be reflected in higher CPU load and less
throughput during topology changes.
- [major] Return error if empty key is passed to an operation. Empty keys will
cause the server to drop the connection.
The error code returned is the newly added `LCB_EMPTY_KEY`
- [minor] Provide setting to disable refreshing the configuration when an HTTP
API error is encountered (from one of the HTTP callback functions). This
adds the `LCB_CNTL_HTTP_REFRESH_CONFIG_ON_ERROR` setting.
* Fri Jun 20 2014 Mark Nunberg <mark.nunberg@couchbase.com> - 2.4.0-0.dp1
- [minor] Make `run_event_loop` and `stop_event_loop` private.
These functions may no longer be used from within an application to
start/stop the event loop. `lcb_wait()` and `lcb_wait3()` should be
used instead.
- [major] Deprecate the `lcb_set_XXX` functions. `lcb_set_timeout`
and some other calls have been deprecated in favor of the `lcb_cntl()`
interface. These functions will still work but will cause the compiler
to print a deprecation warning.
- [minor] `lcb_socket_t` is typedefed to a `DWORD` on windows. In
previous versions this was an `int`.
- [minor] Connecting to a standalone memcached instance is currently no longer
supported.
- [major] `lcb_set_error_callback()` has been deprecated. Applications should
use the new `lcb_set_bootstrap_callback()` and/or operation callbacks
to determine success/failure status.
- [major] `lcb_get_last_error()` has been deprecated. Error information is always
returned in the operation callback
- [major] Disable the sending of `GETQ` packets. The format of this command
is cumbersome to deal with and in most uses cases is actually slightly
_less_ efficient on the network. Note that this does not change the API
of the actual `lcb_get()` call, but simply changes the format of the
packets sent over the wire.
- [major] The IOPS API has been changed. This is considered volatile interface
and may subsequently change in the future as well.
- [major] Additional APIs for `lcb_cntl()`. These consist of helper functions
to make it easier to use simple types or strings rather than pointers, if
possible. These functions are `lcb_cntl_string()`, `lcb_cntl_setu32()` and
`lcb_cntl_getu32()`
- [minor] Provide extended version of `lcb_wait()`.
A new function called `lcb_wait3()` has been added which offers additional
options with respect to running the event loop. Specifically it offers to
bypass the check for pending operations which `lcb_wait()` executes. This
is both more performant and allows us to wait for operations which are
not explicitly scheduled.
- [major] Provide API to request a configuration refresh.
Sometimes it is necessary to force the client to request a new configuration,
for example in certain failover conditions. A new API called `lcb_config_refresh()`
has been added, and should be used in conjunction with `lcb_wait3()`.
- [major] Provide bootstrapping notification callback
This provides an explicit `lcb_set_bootstrap_callback()` to definitively
determine whether the client has received its initial configuration (and
thus may now start performing operations) or whether it failed (and thus
must be reinitialized). This deprecates the common use case of
`lcb_set_error_callback()`.
- [major] New vBucket interface/API. This API is used internally and exposed
as _volatile_ inside the public header files. It provides extended features,
a more concise API, and is compatible with the upcoming Couchbase 3.0 config
format. Note that file-based configuration caches written by this version of
the library are incompatible with previous versions, however this version may
read caches generated by previous versions. This is because this version generates
a stripped-down version of the "terse" configuration style.
- [major] Extended detailed error codes.
These error codes expose more detail about the `NETWORK_ERROR` and
`CONNECT_ERROR` codes returned by previous versions of the library. The extended
codes are not returned by default and must be explicitly enabled in order to
retain backwards compatibility with applications which rely on the older
error codes.
- [major] Connection Strings (aka "dsn") feature for instance creation. This adds a new
version of the `lcb_create_st` structure which is passed a URI-like string
rather than a semicolon-delimited list of hosts. This string is used to
provide options and the list of hosts that the library should connect to.
For example, `couchbase://default/localhost&compression=off`
- [major] SSL transport support for Couchbase 3.0 Enterprise.
Couchbase 3.0 enterprise features the ability to encrypt communications
between the client and the server using the SSL protocol. SSL protocol
support in _libcouchbase_.
- [major] Retry queue for failed operations. The retry queue is used
as a place to place operations which have failed internally and which
should be retried within a certain amount of time. This also provides
options on which commands should be retried.
- [minor] Compression/JSON flag (aka Datatype) support
This adds support for a future feature of Couchbase server which will
feature transparent compression. This feature also allows the server
to signal to the library if a document is JSON or not. The compression
feature may be disabled at compile-time, and may also be modified at
runtime by setting `compression=off` in either the connection string
or via `lcb_cntl_setstring(instance, "compression", "off")`
- [major] Experimental _scheduling_ API. This API replaces most of the older
operation APIs with a scheduling API. These APIs are called with one
command at a time and insert the resultant packet into a pipeline. The
user may "schedule" the commands or "fail" the pipeline if a certain
request has failed to be scheduled.
This API also provides a common ABI header for commands so that they may
easily be used via type-punning, or wrapped as a class hierarchy in C++.
This API is currently considered volatile but will be the basis of the
upcoming libcouchbase 3.0 API. The header file is `<libcouchbase/api3.h>`
- [major] Raw memcached packets may be sent to the library and have a callback
invoked when their responses have been received.
This adds an `lcb_pktfwd3()` API. This requires the new scheduling API.
- [major] _select_ plugin may endlessly loop in some cases
The plugin may loop if there was a long timeout from the
future .
- [major] Do not break TCP connections on topology changes unless ejected from
cluster. This ensures that nodes which are still part of the cluster have their
TCP connections remain in tact despite being shifted in their server index values.
Packets which have been sent to the wrong vBucket are silently ignored and
rescheduled to their appropriate destination. This decreases load significantly
on the client, network, and cluster during topology changes.
- [major] Use new-style "Terse" URI format when requesting a configuration over HTTP.
This uses the HTTP configuration format over the new `/pools/default/bs/default`
rather than the older `/pools/default/bucketsStreaming/default` form. The former
form is much more efficient on the cluster side. If the new URI form is not
supported (i.e. the server responds with an HTTP 404) the older form will be
used instead. You may modify this behavior by setting the `LCB_CNTL_HTCONFIG_URLTYPE`
setting via `lcb_cntl()`.
- [minor] The `cmake/configure` script now accepts the `LDFLAGS`, `CPPFLAGS`, `CFLAGS`,
`CXXFLAGS`, `CC`, and `CXX` settings both within the environment _and_ the
commandline, so the forms of `CC=clang ./cmake/configure` and
`./cmake/configure CC=clang` are equivalent.
- [minor] The `pillowfight` tool will now print latencies between 1-10ms in resolutions
of 100us.
- [major] Use Doxygen for API documentation.
This replaces the _manpages_ for API documentation with Doxygen. Doxygen
is a free and portable documentation system which may be obtained from your
distribution or at [](http://doxygen.org). To generate the documentation
from the source tree, simply run `doxygen` from the source root directory.
To generate internal documentation, run `./docs/gen_internal_apidoc.sh`.
- [major] Add interface attributes to all API calls
This properly documents all API calls with a certain API stability level
such as _committed_ (for stable APIs), _uncomitted_ for APIs which may, but
are not likely to change, and _volatile_ for APIs which are likely to be
changed or removed.
- [major] Public header files have been reorganized
This changes the layout of the header files from previous versions. This should
not affect applications as applications should only ever include the main
`<libcouchbase/couchbase.h>` file.
the following files have been _removed_ from the
`<libcouchbase/*>` header directory:
* `types.h` - Merged into other header files
* `arguments.h` - now a part of `couchbase.h`
* `callbacks.h` - now a part of `couchbase.h`
* `debug.h` - unused and obsolete
* `durability.h` - now a part of `couchbase.h`
* `behavior.h` - Merged into `deprecated.h`
* `sanitycheck.h` - Merged into `deprecated.h`
* `timings.h` - Part of `couchbase.h`
* `compat.h` - Part of `deprecated.h`
The following files have been _added_ into the `<libcouchbase/*>` directory.
Unless otherwise noted, these files are included by `<libcouchbase/couchbase.h>`:
* `api3.h` - Volatile proposed 3.0 API. **Not included by default**
* `cxxwrap.h` - Contains the implementation for the deprecated C++ wrappers
* `deprecated.h` - Contains deprecated APIs
* `iops.h` - Contains the IO integration APIs
* `pktfwd.h` - Contains the packet forwarding API. **Not included by default**
* `vbucket.h` - Contains the vBucket mapping API. **Not included by default**
- OpenSSL is now a base dependency for the library. This may be disabled at configure
time via `--enable-ssl=no`. See `./configure --help`.
- Snappy compression library is bundled and optionally compiled. This is left out by
default as the configure script will search for a system installed `libsnappy`.
Snappy provides the compression feature needed for compressing and inflating data
between client and server. It may be disabled at compile-time via `--enable-snappy=no`
- [minor] _libvbucket_ has been fully integrated into libcouchbase from the forked
_libvbucket_ package and, lives fully as part of the
library. The public vBucket API may be found in `<libcouchbase/vbucket.h>`.
- [minor] As an alternative to the cross-platform `lcb_uintNN_t` typedefs, a shorter
(and more standards compliant) alternative `lcb_UNN` typedefs are provided, thus
instead of `lcb_uint32_t` you may use `lcb_U32`. The full listing of cross platform
typdefs may be found inside `<libcouchbase/sysdefs.h>`
* Thu May 08 2014 Mark Nunberg <mark.nunberg@couchbase.com> - 2.3.1-1
- [major] CCBC-404: Segfault in `connmgr_invoke_request`
Occasionally a segmentation fault would happen when a connection was being
released as a result of a connection failure. This was because of invalid
list tracking.
- [major] CCBC-395: Add `lcb_cntl()` interface for configuration cache
Configuration cache options may be set after instantiation using `lcb_cntl()`
with the new `LCB_CNTL_CONFIGCACHE` operation. The old-style `lcb_create_compat`
creation path is deprecated.
- [major] CCBC-394: Get-with-replica occasionally crashes on Windows and UV
during topology changes. This was due to not allocating a buffer if one did
not exist.
- [major] CCBC-392: ABI compatibility broken between 2.x and 2.3 for
`lcb_create_compat`. This has been fixed by symbol aliasing between versions.
Developers are still recommended to use the `lcb_cntl()` API to set the
configuration cache, as specified in CCBC-395
- [major] CCBC-385: Failed assertion on get-with-replica when connection fails.
If a connection fails with a `CMD_GET_REPLICA` command still in the queue an
assertion failure will crash the library. This has been fixed by handling the
opcode in the `failout_single_request` function.
- [major] CCBC-384: Unknown Winsock error codes crash application. This was fixed
by providing proper handlers for Winsock codes which were not explicitly
converted into their POSIX equivalents.
- [major] CCBC-376: Fix memory leak in configuration parsing. A leak was
introduced in version 2.3.0 by not freeing the JSON pool structure. This has
been fixed in 2.3.1
- [minor] CCBC-370: `lcb_get_host` and `lcb_get_port` may return host-port
combinations from different servers. If multiple servers are listening on
different ports this may result in yielding an invalid endpoint by combining
the output from those two functions. This has been fixed in 2.3.1 by returning
the host and port from the first host, in lieu of a currently-connected REST
endpoint.
- [minor] CCBC-368: Initial bootstrapping failure may mask `LCB_BUCKET_ENOENT`
calls with `LCB_ETIMEDOUT`. This has been fixed by not retrying configuration
retrieval if an explicit HTTP 404 code is received. Note that when using
bootstrap over memcached, a missing bucket may still be manifest as
`LCB_AUTH_ERROR`.
- [minor] CCBC-367: Ensure `lcb_get_host` does not return `NULL` when the
associated `lcb_t` is of `LCB_TYPE_CLUSTER`. This would cause crashes in some
applications which relied on this function to not return `NULL`.
- [major] CCBC-389: Spurious timeouts delivered in asynchronous use cases.
In applications which do not use `lcb_wait()` the library will potentially
time out commands internally triggering an erroneous configuration refresh.
While this issue would not end up failing operations it will cause unnecessary
network traffic for retrieving configurations. Applications using `lcb_wait()`
are not affected as that function resets the timeout handler.
- [major] CCBC-332, CCBC-364: Compare configuration revision information
for memcached cluster bootstrap. Previously we would refresh the
configuration upon receipt
of any new configuration update from memcached. This is fixed in 2.3.1 where
the configuration will only be applied if it is deemed to be newer than the
current configuration. With memcached bootstrap this is only true if the
configuration's `rev` field is higher than the current one.
* Mon Apr 07 2014 Mark Nunberg <mark.nunberg@couchbase.com> - 2.3.0-1
- [major] CCBC-152: Provide a master-only observe option. This adds a new
struct version to the `lcb_observe_cmd_t` which allows to select only the
master node. One can use this to efficiently check if the key exists (without
retrieving it). It also allows one to get the CAS of the item without fetching
it.
- [major] CCBC-281: Fix partial scheduling during multi operations. Previously
the library would deliver spurious callbacks if multiple operations were
scheduled with a single command and one of the operations could not be mapped
to a server. This fixes this behavior and ensures that callbacks are only
invoked for items if the entire API call succeeded.
- [major] CCBC-150: Multi-packet commands will no longer deliver spurious
callbacks on failure. Previously these commands would be relocated to the
same server during a configuration change, resulting in multiple callbacks
for the same command. In this case the client would think all the commands
had been completed, and when the next response arrived it would incorrectly
map it to a different request.
- [minor] CCBC-327: Fix assumption of `vbucket_compare()` only returning if
a diff exists. This function actually returns a non-NULL pointer always
unless it cannot allocate more memory. This bug was introduced with the
_DP1_ release.
- [minor] CCBC-326: Memcached buckets should use streaming config. This was
left unchecked in the _DP1_ release and has now been fixed.
- [major] CCBC-351: Enhance performance for configuration parsing. In previous
versions receiving multiple configurations at once would cause CPU spikes on
slower systems. The configuration parser code has been optimized to alleviate
this issue.
- [minor] CCBC-350: Provide `lcb_cntl()` API to retrieve the SCM changeset used
by the currently loaded binary. This is a more effective way to get the
revision as it does not depend on the specific headers the library was
compiled with.
- [major] CCBC-340: Correctly parse `""`, `"0"` and `"1"` for environment
variables. In previous versions having the entry set to an empty string
or `0` would still be treated by the library as a true value for various
environment variables. This has been fixed so that clear "False" values
such as the empty string or 0 are treated as such.
* Tue Feb 04 2014 Mark Nunberg <mark.nunberg@couchbase.com> - 2.3.0-0.dp1
- [major] CCBC-234: Implementation of Cluster Configuration Carrier Publication.
This is the new and
more efficient way to bootstrap from a cluster using the native memcached
protocol and is quicker than the previous HTTP bootstrap mechanism, dramatically
improving startup times and reducing load on the server. This feature is
available in server verions 2.5 and greater. The existing HTTP configuration is
still supported and will be employed as a fallback in the event that `CCCP`
is not supported.
In conjunction with this, a new struct version has been added to the
`lcb_create_st` parameters structure for use with `lcb_create`. This allows
you to get more control over how the client is initialized:
lcb_t instance;
struct lcb_create_st options;
lcb_config_transport_t enabled_transports = {
LCB_CONFIG_TRANSPORT_CCCP,
LCB_CONFIG_TRANSPORT_LIST_END
};
memset(&options, 0, sizeof(options));
options.version = 2;
options.v.v2.mchosts = "example.com:11210";
options.v.v2.transports = enabled_transports;
lcb_error_t rc = lcb_create(&instance, &options);
if (rc != LCB_SUCCESS) {
fprintf(stderr, "Failed to create instance: %s\n", lcb_strerror(instance, rc));
}
The above snippet will configure a client to _always_ use the `CCCP` protocol
and never attempt to fall back on HTTP
The CCCP implementation required a significant rewrite in how sockets were
created and re-used. Particularly, a connection pooling feature was implemented.
Additionally, the `cbc` command now has an additional `-C` option which accepts
the preferred configuration mechanism to use.
- [major] CCBC-305: Implement logging hooks.
This improvements adds various levels of diagnostic logging with the library
itself. It may be utilized via the environment (by setting the `LCB_LOGLEVEL`
environment variable to a positive integer -- the higher the number the more
verbose the logging).
Integrators may also use the logging API specified in `<libcouchbase/types.h>`
to proxy the library's logging messages into your own application.
Current events logged include connection initialization, destruction, connection
pool management, configuration changes, and timeouts.
By default the library is silent.
- [major] CCBC-316: Allow per-node bootstrap/config timeouts.
This change allows more finer grained control over how long to wait per-node
to receive updated configuration info. This setting helps adjust the initial
and subsequent bootstrap processes to help ensure each node gets a slice of
time.
- [major] CCBC-297: Handle spurious EWOULDBLOCK on UV/Win32
This issue caused odd errors on Windows when large amounts of data
would be received on the socket.
* Wed Nov 06 2013 Sergey Avseyev <sergey@couchbase.com> - 2.2.0
- [major] CCBC-169 Handle 302 redirects in HTTP (views, administrative
requests). By default the library will follow up to three redirects. Once
the limit reached the request will be terminated with code
'LCB_TOO_MANY_REDIRECTS'. Limit is configurable through
'LCB_CNTL_MAX_REDIRECTS'. If set to -1, it will disable redirect limit.
int new_value = 5;
lcb_cntl(instance, LCB_CNTL_SET, LCB_CNTL_MAX_REDIRECTS, &new_value);
- [major] CCBC-243 Replace isasl with cbsasl, the latter has implemented
both PLAIN and CRAM-MD5 authentication mechanisms.
* 'LCB_CNTL_MEMDNODE_INFO' command updated to include effective SASL
mechanism:
cb_cntl_server_t node;
node.version = 1;
node.v.v1.index = 0; /* first node */
lcb_cntl(instance, LCB_CNTL_GET, LCB_CNTL_MEMDNODE_INFO, &node);
if (node.v.v1.sasl_mech) {
printf("authenticated via SASL '%s'\n",
node.v.v1.sasl_mech);
}
* It is also possible to force specific authentication mechanism for
the connection handle using 'LCB_CNTL_FORCE_SASL_MECH' command:
lcb_cntl(instance, LCB_CNTL_SET, LCB_CNTL_FORCE_SASL_MECH, "PLAIN");
- [major] CCBC-286 libuv plugin: use same CRT for free/malloc
- [major] CCBC-288 Fail 'NOT_MY_VBUCKET' responses on timeout
- [major] CCBC-275 Do a full purge when negotiation times out. In this case
we must purge the server from all commands and not simply pop individual
items.
- [major] CCBC-275 Reset the server's buffers upon reconnection. This
fixes a crash experienced when requesting a new read with the
previous buffer still in tact. This was exposed by calling
'lcb_failout_server' on a timeout error while maintaining the same
server struct.
- [major] CCBC-282 Make server buffers reentrant-safe. When purging
implicit commands, we invoke callbacks which may in turn cause other
LCB entry points to be invoked which can shift the contents and/or
positions of the ringbuffers we're reading from.
- [major] CCBC-204, CCBC-205 Stricter/More inspectable behavior for
config cache. This provides a test and an additional 'lcb_cntl'
operation to check the status of the configuration cache. Also it
switches off config cache with memcached buckets.
int is_loaded;
lcb_cntl(instance, LCB_CNTL_GET, LCB_CNTL_CONFIG_CACHE_LOADED, &is_loaded);
if (is_loaded) {
printf("Configuration cache saved us a trip to the config server\n");
} else {
printf("We had to contact the configuration server for some reason\n");
}
- [major] CCBC-278 Use common config retry mechanism for bad
configcache. This uses the same error handling mechanism as when a
bad configuration has been received from the network. New
'LCB_CONFIG_CACHE_INVALID' error code to notify the user of such a
situation
- [major] CCBC-274 Handle getl/unl when purging the server (thanks
Robert Groenenberg)
- [major] Don't failout all commands on a timeout. Only fail those
commands which are old enough to have timed out already.
- [major] CCBC-269 Don't record and use TTP/TTR from observe. Just
poll at a fixed interval, as the responses from the server side can
be unreliable.
- [minor] Allow hooks for mapping server codes to errors. This also
helps handle sane behavior if a new error code is introduced, or
allow user-defined logging when a specific error code is received.
lcb_errmap_callback default_callback;
lcb_error_t user_map_error(lcb_t instance, lcb_uint16_t in)
{
if (in == PROTOCOL_BINARY_RESPONSE_ETMPFAIL) {
fprintf(stderr, "temporary failure on server\n");
}
return default_callback(instance, in);
}
...
default_callback = lcb_set_errmap_callback(conn, user_map_error);
- [minor] Add an example of a connection pool. See
'example/instancepool' directory
- [minor] CCBC-279 Force 'lcb_wait' return result of wait operation
instead of 'lcb_get_last_error'. It returns 'last_error' if and only
if the handle is not yet configured
- [minor] CCBC-284 'cbc-pillowfight': compute item size correctly
during set If 'minSize' and 'maxSize' are set to the same value it
can sometimes crash since it may try to read out of memory bounds
from the allocated data buffer.
- [minor] CCBC-283 Apply key prefix CLI option in cbc-pillowfight
- [minor] Add '--enable-maintainer-mode'. Maintainer mode enables
'--enable-werror --enable-warnings --enable-debug', forces all
plugins to be installed and forces all tests, tools, and examples to
be built
- [minor] CCBC-255 Expose 'LCB_MAX_ERROR' to allow user-defined codes
* Tue Sep 10 2013 Sergey Avseyev <sergey@couchbase.com> - 2.1.3
- [minor] Updated gtest to version 1.7.0. Fixes issue with building
test suite with new XCode 5.0 version being released later this
month.
- [major] CCBC-265 Do not try to parse config for 'LCB_TYPE_CLUSTER'
handles. It fixes timouts for management operations (like 'cbc
bucket-create', 'cbc bucket-flush', 'cbc bucket-delete' and 'cbc
admin')
- [major] CCBC-263 Skip unfinished SASL commands on rebalance. During
rebalance, it is possible that the newly added server doesn't have
chance to finish SASL auth before the cluster will push config
update, in this case packet relocator messing cookies. Also the
patch makes sure that SASL command/cookie isn't mixing with other
commands
- [major] Use cluster type connection for cbc-bucket-flush. Although
flush command is accessible for bucket type connections,
cbc-bucket-flush doesn't use provided bucket name to connect to,
therefore it will fail if the bucket name isn't "default".
- [major] Allow to make connect order deterministic. It allows the user to
toggle between deterministic and random connect order for the supplied
nodes list. By default it will randomize the list.
- [major] Do not allow to use Administrator account for
'LCB_TYPE_BUCKET'
- [major] CCBC-258 Fig segmentation faults during tests load of
node.js. Sets 'inside_handler' on 'socket_connected'. Previously we
were always using SASL auth, and as such, we wouldn't flush packets
from the 'cmd_log' using 'server_send_packets' (which calls
'apply_want'). 'apply_want' shouldn't be called more than once per
event loop entry -- so this sets and unsets the 'inside_handler'
flag.
- [major] Added support of libuv 0.8
- [major] Close config connection before trying next node. It will fix
asserts in case of the config node becomes unresponsive, and the
threshold controlled by LCB_CNTL_CONFERRTHRESH and lcb_cntl(3)
* Mon Aug 26 2013 Sergey Avseyev <sergey@couchbase.com> - 2.1.2
- [major] CCBC-253, CCBC-254 Use bucket name in SASL if username
omitted. Without this fix, you can may encounter a segmentation
faults for buckets, which are not protected by a password.
- [major] Preserve IO cookie in `options_from_info` when using v0
plugins with user-provided IO loop instance. This issue was
introduced in 2.1.0.
- [minor] Display the effective IO backend in 'cbc-version'. This is
helpful to quickly detect what is the effective IO plugin on a given
system.
* Thu Aug 22 2013 Sergey Avseyev <sergey@couchbase.com> - 2.1.1
- [minor] Use provided credentials for authenticating to the data
nodes. With this fix, it is no longer possible to use Administrator
credentials with a bucket. If your configuration does so, you must
change the credentials you use before applying this update. No
documentation guides use of Administrator credentials, so this
change is not expected to affect few, if any deployments.
- [major] CCBC-239 Do not use socket after failout. Fixes segmentation
faults during rebalance.
- [minor] CCBC-245 Distribute debug information with release binaries
on Windows
- [minor] CCBC-248 Do not disable config.h on UNIX-like platforms. It
fixes build issue, when application is trying to include plugins
from the tarball.
- [major] CCBC-192 Skip misconfigured nodes in the list. New
lcb\_cntl(3couchbase) added to control whether the library will skip
nodes in initial node list, which listen on configuration port (8091
usually) but doesn't meet required parameters (invalid
authentication or missing bucket). By default report this issue and
stop trying nodes from the list, like all previous release. Read
more at man page lcb\_cntl(3couchbase) in section
LCB\_CNTL\_SKIP\_CONFIGURATION\_ERRORS\_ON\_CONNECT
- [major] CCBC-246 Fallback to 'select' IO plugin if default plugin
cannot be loaded. On UNIX-like systems, default IO backend is
'libevent', which uses third-party library might be not available
at the run-time. Read in lcb\_cntl(3couchbase) man page in section
LCB\_CNTL\_IOPS\_DEFAULT\_TYPES about how to determine effective IO
plugin, when your code chose to use LCB\_IO\_OPS\_DEFAULT during
connection instantiation. The fallback mode doesn't affect
application which specify IO backend explicitly.
* Sat Aug 17 2013 Sergey Avseyev <sergey@couchbase.com> - 2.1.0
- [major] New backend `select`. This backend is based on the select(2)
system call and its Windows version. It could be considered the most
portable solution and is available with the libcouchbase core.
- [major] CCBC-236 New backend `libuv`. This backend previously was
part of the `couchnode` project and is now available as a plugin.
Because libuv doesn't ship binary packages there is no binary
package `libcouchbase2-libuv`. You can build plugin from the source
distribution, or through the `libcouchbase-dev` or
`libcouchbase-devel` package on UNIX like systems.
- [major] New backend `iocp`. This is a Windows specific backend,
which uses "I/O Completion Ports". As a part of the change, a new
version of plugin API was introduced which is more optimized to this
model of asynchronous IO.
- [major] CCBC-229 Fixed bug when REPLICA_FIRST fails if first try
does not return key
- [major] CCBC-228 Fixed bug when REPLICA_SELECT didn't invoke
callbacks for negative error codes
- [major] CCBC-145 API for durability operations. This new API is
based on `lcb_observe(3)` and allows you to monitor keys more
easily. See the man pages `lcb_durability_poll(3)` and
`lcb_set_durability_callback(3)` for more info.
- [major] New configuration interface lcb_cntl(3) along with new
tunable options of the library and connection instances. In this
release the following settings are available. See the man page for
more information and examples.:
- LCB_CNTL_OP_TIMEOUT operation timeout (default 2.5 seconds)
- LCB_CNTL_CONFIGURATION_TIMEOUT time to fetch cluster
configuration. This is similar to a connection timeout (default 5
seconds)
- LCB_CNTL_VIEW_TIMEOUT timeout for couchbase views (default 75
seconds)
- LCB_CNTL_HTTP_TIMEOUT timeout for other HTTP operations like
RESTful flush, bucket creating etc. (default 75 seconds)
- LCB_CNTL_RBUFSIZE size of the internal read buffer (default
32768 bytes)
- LCB_CNTL_WBUFSIZE size of the internal write buffer (default
32768 bytes)
- LCB_CNTL_HANDLETYPE type of the `lcb_t` handler (readonly)
- LCB_CNTL_VBCONFIG returns pointer to VBUCKET_CONFIG_HANDLE
(readonly)
- LCB_CNTL_IOPS get the implementation of IO (lcb_io_opt_t)
- LCB_CNTL_VBMAP get vBucket ID for a given key
- LCB_CNTL_MEMDNODE_INFO get memcached node info
- LCB_CNTL_CONFIGNODE_INFO get config node info
- LCB_CNTL_SYNCMODE control synchronous behaviour (default
LCB_ASYNCHRONOUS)
- LCB_CNTL_IP6POLICY specify IPv4/IPv6 policy (default
LCB_IPV6_DISABLED)
- LCB_CNTL_CONFERRTHRESH control configuration error threshold
(default 100)
- LCB_CNTL_DURABILITY_TIMEOUT durability timeout (default 5 seconds)
- LCB_CNTL_DURABILITY_INTERVAL durability polling interval (default
100 milliseconds)
- LCB_CNTL_IOPS_DEFAULT_TYPES get the default IO types
- LCB_CNTL_IOPS_DLOPEN_DEBUG control verbose printing of dynamic
loading of IO plugins.
* Tue Jul 09 2013 Sergey Avseyev <sergey@couchbase.com> - 2.0.7
[Mark Nunberg]
- Add ringbuffer_take_buffer
- Plug various leaks in tests
- Allow using of external plugins with environment variables
- Only allocate iops after instance
- Allow db.c to exit gracefully on receiving a signal
- Don't create custom iops in db
- CCBC-221: Don't use iops in minimal.c
[Sergey Avseyev]
- It reports LCB_DLOPEN_FAILED if built without IO plugins
- Allow to choose plugin constructor without using dlopen(3)
- [cbc] Fix observe output formatting
- Allow to set SET/GET ratio
- Allow to set minimum and maximum size of payload
- GET/SET Ratio is in integer percents (fixes helpstring)
- Let pillowfight to be a dumb client
- pillowfight: timestamp messages in timings mode
- Do not call connect for dumb pillowfight
- Always use fixed notation for timestamps in pillowfight
- Allow to execute any 'cbc-XXX' binary in PATH like 'cbc XXX'
- Make pillowfight part of the package
- CCBC-183 Improve lcb_get_replica()
- Update metadata for release 2.0.7
[Trond Norbye]
- Simplify build script compile src/gethrtime.c for all platforms
- CCBC-209 Add support for building with CMake on win32
- Add support for building pillowfight on win32
[Volker Mische]
- Add missing free()
* Tue May 07 2013 Sergey Avseyev <sergey@couchbase.com> - 2.0.6
[Mark Nunberg]
- Don't invoke HTTP callbacks after cancellation
- CCBC-202: Don't try to switch to backup nodes when timeout is reached
[Sergey Avseyev]
- Minor fix for phrasing on the pillowfight note.
- CCBC-188 Check if SASL struct valid before disposing
- example/yajl/couchview.c: pass cookie to the command
- CCBC-188 Fix segfault when rebalancing
- CCBC-179 Provide an example about least privilege principle
[Trond Norbye]
- Fix compile error with sun studio
- Allow a direct write mode
- Revert "Allow a direct write mode"
- Add Host header in http request
- Fix buffer overrun
- Tune dump program a bit
* Fri Apr 05 2013 Sergey Avseyev <sergey@couchbase.com> - 2.0.5
[Sergey Avseyev]
- cbc.cc: Put newline after document body for interactive users
- pillowfight.cc: Initialize seqno array with rand()
- pillowfight.cc: initialize data blob with pattern
- pillowfight.cc: fix leaking event loop descriptors
- pillowfight.cc: allow gracefully terminate the loop
- pillowfight.cc: use C linkage for signal handlers
- pillowfight.cc: put new lines before connect errors
- pillowfight.cc: extract pool object out of thread context
- pillowfight.cc: use SIG_IGN instead
- pillowfight.cc: allow to share IO object in single-threaded mode only
- pillowfight.cc: use pthreads
- EAFNOSUPPORT should be mapped to LCB_CONNECT_EFAIL on windows
- configure.ac: NULL isn't standard thing, so require stdlib.h
- Fix build for FreeBSD
- Fix lcb_set_store_callback() signature in man page
- Fix manpages for HTTP callbacks
[Trond Norbye]
- Extend pillowfight a bit
- Fix spelling in lcb_behavior_get_syncmode man page
- Disable pillowfight for win32
- Fix compile problems on macosx
- Use _WIN32 instead of WIN32
- Fixed purging during disconnect
- Adjust flags to support older Sun Studios
- Support C++ compilers without C99 __func__
- Fix compile failure on Solaris with Sun Studio
- URL-encode characters in the path
- CCBC-190: Create compat mode that cache configuration
- ssize_t ==> lcb_ssize_t
[Yury Alioshinov]
- Reconnect on EINVAL for windows
[Mark Nunberg]
- NUL-terminate config cache buffer after reading
* Wed Mar 06 2013 Sergey Avseyev <sergey@couchbase.com> - 2.0.4
[Sergey Avseyev]
- CCBC-175 Work properly on systems where EWOULDBLOCK != EAGAIN
- Install pdb files for windows
- CCBC-147 Fixed illegal memory access in win32 plugin
- Destroy all events in win32 plugin destructor
- Be more secure about pointers in event lists (win32 plugin)
- Align buffers on HP-UX systems (thanks to Yury Alioshinov)
- Define -D_REENTRANT to ensure errno is threadsafe
- CCBC-180 Do not destroy event struct in release_socket()