Commits on May 31, 2013
  1. Revert "MB-8020 Change compacted file layout"

    This reverts commit c18c5b2.
    
    Conflicts:
    	src/db_compact.c
    
    Change-Id: I04b7563eb18202877457c96c772bbc1810e42e62
    committed May 31, 2013
Commits on May 28, 2013
  1. MB-8066 Compactor should only evict bodies on request

    Change-Id: I476bd3994dc65618af3db478c2fd74381fc4c003
    Reviewed-on: http://review.couchbase.org/26504
    Reviewed-by: Filipe David Borba Manana <fdmanana@gmail.com>
    Tested-by: Aaron Miller <apage43@ninjawhale.com>
    committed May 23, 2013
Commits on May 10, 2013
  1. MB-8030 Give explicit types for *all* numbers in couchstore.py

    Change-Id: Ie41f09e20a2a6c83061c62fcdc69944c24565fb3
    Reviewed-on: http://review.couchbase.org/26248
    Reviewed-by: Bin Cui <bin.cui@gmail.com>
    Tested-by: Aaron Miller <apage43@ninjawhale.com>
    committed May 10, 2013
Commits on May 6, 2013
  1. @pavel-paulau

    MB-7879: wrap python integers into c_uint64

    Using Python values as they are is not safe. We must explicitly
    specify uint64_t in order to avoid problems with 32-bit platforms.
    
    All unit tests passed (both 32-bit and 64-bit GNU/Linux).
    
    Change-Id: Id3c9544908f2c02ac94fcdf62f222d75740f3c89
    Reviewed-on: http://review.couchbase.org/26131
    Reviewed-by: Bin Cui <bin.cui@gmail.com>
    Tested-by: Aaron Miller <apage43@ninjawhale.com>
    Reviewed-by: Aaron Miller <apage43@ninjawhale.com>
    pavel-paulau committed with May 6, 2013
Commits on Apr 30, 2013
  1. @bcui6611

    MB-8131: Have to copy explicit icu dlls with version number

    Change-Id: I63bab95958baf77729bf90a2288c8a8bb3591798
    Reviewed-on: http://review.couchbase.org/25957
    Tested-by: Bin Cui <bin.cui@gmail.com>
    Reviewed-by: Sriram Melkote <siri.couchbase@gmail.com>
    Reviewed-by: Steve Yen <steve.yen@gmail.com>
    bcui6611 committed Apr 29, 2013
Commits on Apr 26, 2013
  1. @bcui6611

    MB-8131: Add icu dlls to staging area during build

    Change-Id: Ia9dc781ed92a8aa2903cd6f3cefe68be275fccec
    Reviewed-on: http://review.couchbase.org/25913
    Reviewed-by: Sriram Melkote <siri.couchbase@gmail.com>
    Tested-by: Bin Cui <bin.cui@gmail.com>
    bcui6611 committed Apr 25, 2013
Commits on Apr 23, 2013
  1. Update windows file_ops to v4

    Change-Id: Ic4d5c861f8c9dc413791cadb9f9c347487940369
    Reviewed-on: http://review.couchbase.org/25837
    Reviewed-by: Michael Wiederhold <mike@couchbase.com>
    Tested-by: Aaron Miller <apage43@ninjawhale.com>
    committed Apr 22, 2013
Commits on Apr 15, 2013
  1. MB-8020 Evict doc bodies from cache after compaction.

    Change-Id: I16219540c0887e780d662b31d922cd11ee37bf43
    Reviewed-on: http://review.couchbase.org/25606
    Reviewed-by: Filipe David Borba Manana <fdmanana@gmail.com>
    Reviewed-by: Volker Mische <volker.mische@gmail.com>
    Tested-by: Aaron Miller <apage43@ninjawhale.com>
    committed Feb 26, 2013
  2. MB-8020 Add advice call to OS layer

    Will be ignored outside of linux for now, and only supports EVICT
    (DONTNEED).
    
    This adds a function to and bumps the version number of the file_ops
    interface.
    
    Change-Id: I6646d76c6bf72c2a3740df98e26c80902c7db3fc
    Reviewed-on: http://review.couchbase.org/25605
    Reviewed-by: Filipe David Borba Manana <fdmanana@gmail.com>
    Reviewed-by: Volker Mische <volker.mische@gmail.com>
    Tested-by: Aaron Miller <apage43@ninjawhale.com>
    committed Feb 25, 2013
  3. MB-8020 Change compacted file layout

    Compactor will now output all doc bodies, then the Sequence b-tree, then
    the ID b-tree, rather than outputting the doc bodies and the sequence
    b-tree interleaved.
    
    Change-Id: I0cde3764a1f23c0e8547f27e12da670715928125
    Reviewed-on: http://review.couchbase.org/25604
    Reviewed-by: Filipe David Borba Manana <fdmanana@gmail.com>
    Tested-by: Aaron Miller <apage43@ninjawhale.com>
    committed Feb 25, 2013
Commits on Mar 22, 2013
  1. @trondn

    Merge remote-tracking branch 'couchbase/2.0.1' into update

    * couchbase/2.0.1:
      MB-6657: cs_off_t should be a signed variable
      MB-6657: Use 64 bits type for file offsets on Windows
    
    Conflicts:
    	src/couch_db.c
    	src/couch_file_read.c
    	src/couch_file_write.c
    	src/couch_save.c
    	src/internal.h
    
    Change-Id: Ic1c1b79c79368c39806d4bf95ed347a3dce71b9d
    trondn committed Mar 22, 2013
Commits on Mar 21, 2013
  1. @trondn

    MB-6657: cs_off_t should be a signed variable

    off_t is supposed to be signed
    
    Change-Id: I7c30bea3d534cd01b2d576815f0841bd96e66c23
    Reviewed-on: http://review.couchbase.org/25282
    Reviewed-by: Filipe David Borba Manana <fdmanana@gmail.com>
    Tested-by: Trond Norbye <trond.norbye@gmail.com>
    trondn committed Mar 21, 2013
  2. @fdmanana

    MB-6657: Use 64 bits type for file offsets on Windows

    Windows follows the LLP64 data model:
    http://en.wikipedia.org/wiki/LLP64#64-bit_data_models
    
    This means both the int and long int types have a size of 32 bits
    regardless if it's a 32 or 64 bits Windows system.
    
    And Windows defines the type off_t as being a signed long integer:
    http://msdn.microsoft.com/en-us/library/323b6b3k.aspx
    
    Therefore we can't use off_t on Windows if we deal with files that
    can have a size of 2Gb or more.
    
    By using off_t to represent offsets and doing arithmetic operations
    on offsets of this type, such operations result in negative values
    when they should produce a value larger than 2Gb. Such negative values
    are then converted by os_win.c operations into unsigned 32 bits
    integers, as 'Offset' members of a structure of type OVERLAPPED.
    This means we can end up overwriting previous data from the file
    because couchstore opens files in read/write mode (and not in append
    only mode) and does "pwrite" operations with an offset stored in
    the db record which is of type off_t and gets incremented after every
    write operation.
    
    Other databases and VMs use a custom 64 bits integer on Windows to
    represent file offsets, rather than the type off_t.
    
    References:
    
    SQLite:
    
    http://www2.sqlite.org/cgi/src/artifact/eabd00b813577d36bd66271cb08dd64ea0589dac
    (function seekWinFile for example)
    
    Python:
    
    http://bugs.python.org/issue12517
    
    Erlang:
    
    https://github.com/erlang/otp/blob/2d03ab7ffde828d3b56f8b7738fd0c00d0f5b630/erts/emulator/drivers/win32/win_efile.c#L1048
    
    Change-Id: Ib49ac055e3073480f696576cc17c791d0349b773
    Reviewed-on: http://review.couchbase.org/25268
    Tested-by: Trond Norbye <trond.norbye@gmail.com>
    Reviewed-by: Sriram Melkote <siri.couchbase@gmail.com>
    fdmanana committed with Sriram Melkote Mar 20, 2013
Commits on Mar 20, 2013
  1. @bcui6611

    CBD-913: ICU50 rename libaries

    Compared to icu4.x, icu5.0 rename the following libraries:
    icudata.dll -> icudt.dll
    icui18n.dll -> icuin.dll
    
    Change-Id: I932a97b3bc052c8cdfd873af03a24af68c0e24b2
    Reviewed-on: http://review.couchbase.org/25247
    Reviewed-by: Bin Cui <bin.cui@gmail.com>
    Tested-by: Bin Cui <bin.cui@gmail.com>
    bcui6611 committed Mar 19, 2013
Commits on Mar 18, 2013
  1. @fdmanana @bcui6611

    Remove reference to no longer existing file win32.c

    Backport from master
    
    Change-Id: I165c958213dd120b7fe894cc7a11a64b94698370
    Reviewed-on: http://review.couchbase.org/25214
    Reviewed-by: Bin Cui <bin.cui@gmail.com>
    Tested-by: Bin Cui <bin.cui@gmail.com>
    fdmanana committed with bcui6611 Feb 14, 2013
Commits on Feb 25, 2013
  1. Merge branch 'master' into 2.0.2

    Not sure why 2.0.2 wasn't branched off of master, but I need those changes.
    
    Change-Id: I1b95d46a16410aa6540427a8d862e666e63cd5a8
    committed Feb 25, 2013
Commits on Feb 14, 2013
  1. CBD-839: create 2.0.2 branch off of 2.0.1 at 146c965

    Change-Id: I562aaa5a308959ddb028b40054fdef338dd979cb
    Reviewed-on: http://review.couchbase.org/24590
    Reviewed-by: Philip Labee <philip@couchbase.com>
    Tested-by: Philip Labee <philip@couchbase.com>
    Phil Labee committed with Philip Labee Feb 13, 2013
Commits on Feb 12, 2013
  1. Merge branch origin/2.0.1

    Conflicts:
    	src/db_compact.c
    
    Change-Id: I7864694a01bf6a6cfdb039a35702e78bdd8b51a3
    committed Feb 11, 2013
Commits on Feb 6, 2013
  1. Keep file format documentation in the repo

    The format documentation should be packaged with and versioned with the
    library.
    
    cbugg: closes bug-204
    
    http://cbugg.hq.couchbase.com/bug/bug-204
    
    Change-Id: If9be65f6902e16f85aa4649f2ed38d94daf42714
    Reviewed-on: http://review.couchbase.org/24435
    Reviewed-by: Fulu Li <fulu@couchbase.com>
    Tested-by: Aaron Miller <apage43@ninjawhale.com>
    committed Feb 5, 2013
Commits on Feb 1, 2013
  1. Merge indexer branch

    Conflicts:
    	Makefile.am
    	include/libcouchstore/couch_db.h
    	src/btree_read.c
    	src/couch_db.c
    	src/couch_save.c
    	src/db_compact.c
    	src/dbdump.c
    	src/internal.h
    	src/node_types.h
    	tests/testapp.c
    
    Change-Id: I6e154a2b9fe9e815a6a167902f357fbd065e972a
    committed Feb 1, 2013
  2. Don't segfault when tmpfile() fails.

    Fixes bug-143 http://cbugg.hq.couchbase.com/bug/bug-143
    
    If tmpfile() returns NULL, return COUCHSTORE_ERROR_OPEN_FILE. This can
    happen if /tmp is not writable by Couchbase, as seen in JIRA MB-7587.
    
    Change-Id: Ie67c342f3b56aa890e025b4eb747dcec385d80c6
    Reviewed-on: http://review.couchbase.org/24169
    Reviewed-by: Filipe David Borba Manana <fdmanana@gmail.com>
    Reviewed-by: Fulu Li <fulu@couchbase.com>
    Tested-by: Aaron Miller <apage43@ninjawhale.com>
    committed Jan 23, 2013
Commits on Jan 29, 2013
  1. @fdmanana

    Merge remote-tracking branch 'origin/2.0.1'

    * origin/2.0.1:
      Fix implicit pointer to integral type cast
      Fix strict aliasing issue/warning
    
    Change-Id: I476ab04812ec98b8283cbb11e9423bfa4724dc5d
    fdmanana committed Jan 29, 2013
Commits on Jan 28, 2013
  1. @fdmanana @fdmanana

    Fix implicit pointer to integral type cast

    From gcc:
    
    src/db_compact.c:87:5: warning: passing argument 3 of 'couchstore_compact_db_ex' makes integer from pointer without a cast [enabled by default]
    src/db_compact.c:40:20: note: expected 'uint64_t' but argument is of type 'void *'
    
    Change-Id: I9326c2bb4ff639fca995f1de4c0f5fe5172c11a1
    Reviewed-on: http://review.couchbase.org/24162
    Reviewed-by: Fulu Li <fulu@couchbase.com>
    Reviewed-by: Aaron Miller <apage43@ninjawhale.com>
    Tested-by: Aaron Miller <apage43@ninjawhale.com>
    Tested-by: Filipe David Borba Manana <fdmanana@gmail.com>
    fdmanana committed with fdmanana Jan 23, 2013
  2. @fdmanana @fdmanana

    Fix strict aliasing issue/warning

    For the levels 2 and 3 of the -Wstrict-aliasing flag,
    gcc (4.6.3) emitted the following warning:
    
    src/node_types.h: In function 'decode_kv_length':
    src/node_types.h:81:5: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
    
    Which is dangerous since by default we compile with -O2.
    
    Change-Id: Ibffc6a4188715a7562d14bfd8d83e0843ab606d6
    Reviewed-on: http://review.couchbase.org/24159
    Reviewed-by: Fulu Li <fulu@couchbase.com>
    Reviewed-by: Aaron Miller <apage43@ninjawhale.com>
    Tested-by: Aaron Miller <apage43@ninjawhale.com>
    Tested-by: Filipe David Borba Manana <fdmanana@gmail.com>
    fdmanana committed with fdmanana Jan 23, 2013
Commits on Jan 25, 2013
  1. @trondn

    CBD-774: Add support for automake 1.13

    Change-Id: Ibc0b3f6a745deacc2f7cc7624b10d405ad20ae99
    Reviewed-on: http://review.couchbase.org/23970
    Reviewed-by: Aaron Miller <apage43@ninjawhale.com>
    Tested-by: Aaron Miller <apage43@ninjawhale.com>
    trondn committed with Jan 16, 2013
Commits on Jan 22, 2013
  1. CBD-720 Add deletion dropping mode to compactor

    Change-Id: If20f7477276dddf197663886f3325e5164a9dc59
    Reviewed-on: http://review.couchbase.org/23836
    Reviewed-by: Damien Katz <damien@couchbase.com>
    Reviewed-by: Fulu Li <fulu@couchbase.com>
    Tested-by: Fulu Li <fulu@couchbase.com>
    Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
    Reviewed-by: Volker Mische <volker.mische@gmail.com>
    committed with Damien Katz Jan 7, 2013
Commits on Jan 8, 2013
  1. @fulu

    MB-7502 Fix inner node callbacks for walk API

    I accidentally killed this code in a merge, and it broke
    couch_dbdump's --tree option.
    
    Change-Id: I549bd8d4ee141775b5a821889a68bfe66092867e
    Reviewed-on: http://review.couchbase.org/23769
    Reviewed-by: Fulu Li <fulu@couchbase.com>
    Tested-by: Fulu Li <fulu@couchbase.com>
    committed with fulu Jan 7, 2013
Commits on Dec 26, 2012
  1. Merge tag '2.0.0' into master

    2.0.0
    
    * tag '2.0.0':
      MB-7297 Use size_t for python wrapping for 32-bit support
      MB-7306 Fix to the memory leak in lookup_callback()
    
    Change-Id: I97cacb5970f7f7ac3bacaf05394b987697fd79c3
    Aliaksey Kandratsenka committed Dec 26, 2012
Commits on Dec 18, 2012
  1. @alk

    MB-100: use optimized 64-bit byteswap code on GNU/Linux

    glibc does not have htonll but it does have bswap_64 as well as bsd's
    htobe64. bswap_64 is more than good enough.
    
    Change-Id: Iab325a0a5872d3a9379dac565ea177fe4bf6d9cb
    Reviewed-on: http://review.couchbase.org/21493
    Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
    Tested-by: Aaron Miller <apage43@ninjawhale.com>
    Reviewed-by: Damien Katz <damien@couchbase.com>
    Reviewed-by: Aaron Miller <apage43@ninjawhale.com>
    Aliaksey Kandratsenka committed with alk Sep 13, 2012
Commits on Dec 2, 2012
  1. @steveyen

    MB-7297 Use size_t for python wrapping for 32-bit support

    The couchstore/couch_db.h uses size_t for several struct fields, and
    size_t can be either 32-bits or 64-bits, depending on platform.
    So, instead of c_ulonglong, use c_size_t for those fields.
    
    Here, we assume sizeof(off_t) == sizeof(size_t). Not a 100%
    bulletproof assumption, but it seems to work on tests.
    
    Additionally, use uint64_t for the couchstore_open_db() flags
    parameter rather than the platform-specific int.
    
    Change-Id: I36898d0260d44d57fe16ff7e16c7759c4686b4e4
    Reviewed-on: http://review.couchbase.org/22969
    Tested-by: Steve Yen <steve.yen@gmail.com>
    Reviewed-by: Aaron Miller <apage43@ninjawhale.com>
    Tested-by: Aaron Miller <apage43@ninjawhale.com>
    steveyen committed with Farshid Ghods Dec 1, 2012
Commits on Dec 1, 2012
  1. @chiyoung

    MB-7306 Fix to the memory leak in lookup_callback()

    Change-Id: Id7d73a09c55d965405aae4d50ce2f9d63057e3ba
    Reviewed-on: http://review.couchbase.org/22966
    Reviewed-by: Jin Lim <jin@couchbase.com>
    Tested-by: Jin Lim <jin@couchbase.com>
    Reviewed-by: Aaron Miller <apage43@ninjawhale.com>
    chiyoung committed with Farshid Ghods Nov 30, 2012
Commits on Nov 2, 2012
  1. @steveyen

    MB-6945 Increase rev_seq width to 48 bits

    Also moving rev_seq before content_meta for better alignment.
    
    Change-Id: Iac25b95ff4f1ace7145eb2b9f01e26bfeee7cf69
    Reviewed-on: http://review.couchbase.org/22104
    Reviewed-by: Damien Katz <damien@couchbase.com>
    Tested-by: Steve Yen <steve.yen@gmail.com>
    committed with steveyen Oct 30, 2012
  2. @steveyen

    MB-6945 Backport file format refactor from indexer

    Pulling in changes from commit c7b1432 on the indexer branch.
    Originally reviewed at http://review.couchbase.org/19815
    
    These changes consolidate the file format definition and
    make code dealing with the file format cleaner, and also
    make it much easier to change the file format.
    
    Change-Id: I4ee37e66f451fb77fcc3f6264a262c9bbb5417e6
    Reviewed-on: http://review.couchbase.org/22103
    Reviewed-by: Jens Alfke <jens@couchbase.com>
    Reviewed-by: Damien Katz <damien@couchbase.com>
    Tested-by: Damien Katz <damien@couchbase.com>
    committed with steveyen Oct 30, 2012
Commits on Oct 19, 2012
  1. @pavel-paulau

    MB-6928: import ctypes with fallback

    Fallback steps:
    1. Try to import ctypes from our library
    2. If import fails - remove couchbase library from system path and
    try again.
    3. Exit if it still fails; otherwise return library to system path
    and keep working.
    
    Change-Id: I2b556597bb070b1426ca6824af6e9f58bf363953
    Reviewed-on: http://review.couchbase.org/21750
    Reviewed-by: Bin Cui <bin.cui@gmail.com>
    Tested-by: Pavel Paulau <pavel.paulau@gmail.com>
    pavel-paulau committed with Farshid Ghods Oct 18, 2012
Commits on Oct 16, 2012
  1. @mikewied

    MB-6921: Return NO_HEADERS when opening a non-existent file READ_ONLY

    When doing a get on a file that doesn't have headers and we pass in
    the READ_ONLY flag from ep-engine and this will cause us to return
    the error CHECKSUM_FAILED which is converted into a TMP_FAIL in
    ep-engine. It would be much more clear to return a NO_HEADER
    error since ew can infer that the file doesn't have any data yet. Then
    from the ep-engine side we can map this error to not found.
    
    Change-Id: I058c49e26a2bc6186bff62959a232ab160d4cde4
    Reviewed-on: http://review.couchbase.org/21647
    Tested-by: Michael Wiederhold <mike@couchbase.com>
    Reviewed-by: Aaron Miller <apage43@ninjawhale.com>
    Tested-by: Aaron Miller <apage43@ninjawhale.com>
    Reviewed-by: Jens Alfke <jens@couchbase.com>
    mikewied committed with Peter Wansch Oct 15, 2012