Permalink
Commits on Feb 24, 2017
  1. MB-21350 Expose Extended attributes a.k.a XATTR to views

    Extended Attributes that are streamed by KV are now included
    in the metadata information of the document and are accessible
    by views as `meta.xattrs` property
    
    Sample metadata of document with xattrs now looks like
    {
      "id": "xattr_demo_doc",
      "rev": "4-14a501b8539400000000000002000000",
      "seq": "4",
      "vb": "321",
      "expiration": 0,
      "flags": 33554432,
      "type": "json",
      "xattrs": {
        "doc": {
          "readcount": [
            10,
            11
          ],
          "author": "Jack"
        },
        "_sync": {
          "channels": [
            "UK",
            "USA",
            "EU"
          ]
        }
      }
    }
    
    whereas sample metadata of document not having xattrs looks like
    {
      "id": "pymc0",
      "rev": "1-14a501f28e5b00000000000000000000",
      "seq": "1",
      "vb": "449",
      "expiration": 0,
      "flags": 0,
      "type": "json",
      "xattrs": {}
    }
    
    Change-Id: Iefb8d507a23737acdbe98ee632a0e7f09bdcde38
    Reviewed-on: http://review.couchbase.org/73817
    Tested-by: Harsha H S <hhs.couchbase@gmail.com>
    Reviewed-by: Abhishek Singh <abhishek@couchbase.com>
    hsharsha committed with hsharsha Feb 17, 2017
Commits on Feb 10, 2017
  1. MB-22588 Fix the error in spawning spatial updater

    Change-Id: I946f68b7e8425e92984d111556651c1b7886a3c4
    Reviewed-on: http://review.couchbase.org/73322
    Reviewed-by: Harsha H S <hhs.couchbase@gmail.com>
    Tested-by: Harsha H S <hhs.couchbase@gmail.com>
    nimishzynga committed with nimishzynga Feb 8, 2017
Commits on Feb 2, 2017
  1. MB-22525 DCP_OPEN_NO_VALUE is made global per connection flag

    For views that do not use document fields, only metadata was
    streamed from dcp. Earlier this was done by setting NO_VALUE
    flag for every open stream request.
    Now this flag is a global flag which is set while opening a
    new DCP connection, as there was no use-case for selectively
    streaming metadata from specific subset of vbuckets.
    
    Change-Id: Ibb50e70aa2817d9c8a29876adf178b5b1afacce6
    Reviewed-on: http://review.couchbase.org/72946
    Reviewed-by: Harsha H S <hhs.couchbase@gmail.com>
    Tested-by: Harsha H S <hhs.couchbase@gmail.com>
    hsharsha committed with hsharsha Jan 31, 2017
Commits on Jan 31, 2017
  1. MB-22317 Stop the updater for spatial view

    Stop the spatial updater after receiving the stop message
    
    Change-Id: Idbc4a0b14eff39b9738e237c512706837c8cbb37
    Reviewed-on: http://review.couchbase.org/72792
    Reviewed-by: Harsha H S <hhs.couchbase@gmail.com>
    Reviewed-by: Abhishek Singh <abhishek@couchbase.com>
    Tested-by: Abhishek Singh <abhishek@couchbase.com>
    nimishzynga committed with abhi-bit Jan 20, 2017
Commits on Dec 7, 2016
  1. MB-21594 Remove old partition versions during rebalance

    When a new vbucket is moved into a node during rebalance, for
    which there is no sequence number information, we add 0 as the
    start sequence number and {0, 0} as the failover log for that
    partition version.
    There are cases, where older failover log is still lingering in
    the partition version table and this fix clears that information.
    
    Also this results in duplicate partition as ordsets treats
    {PartId, [{0,0}]} and {PartId, [{UUID1, Seq1}, {UUID2, Seq2}]}
    as two different keys.
    
    Change-Id: Idf1e669a377c365f5f1fecc57f2daabba9edec8d
    Reviewed-on: http://review.couchbase.org/70389
    Tested-by: buildbot <build@couchbase.com>
    Reviewed-by: Abhishek Singh <abhishek@couchbase.com>
    harsha committed with hsharsha Nov 28, 2016
Commits on Nov 1, 2016
  1. Revert "Merge remote-tracking branch 'couchbase/watson'"

    I didn't mean to revert master to the state before the dcp client
    changes. So this reverts this faulty merge.
    
    This reverts commit 39c7fbc, reversing
    changes made to a6402a9.
    
    Change-Id: I42b097ff809aa9f073bb4c6c228d400def5d122f
    Reviewed-on: http://review.couchbase.org/69386
    Reviewed-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
    Tested-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
    aartamonau committed Nov 1, 2016
  2. Merge remote-tracking branch 'couchbase/watson'

    * couchbase/watson:
      Revert dcp client changes.
    
    Change-Id: I78ff3321010ddefe9f9b7acd76f7c5755ddd8c26
    aartamonau committed Nov 1, 2016
  3. Merge remote-tracking branch 'couchbase/sherlock' into watson

    * couchbase/sherlock:
      Revert dcp client changes.
      MB-21509 Always ack whatever is in the queue when removing it.
      MB-21509 Crash if close_stream returns unexpected error.
      MB-21509 [Backport] MB-21303 Handle race between stream addition and updater exit
      MB-21509 [Backport] MB-21303 Address leak in stream_info queue
      MB-21509 [Backport] MB-21303 Handle ack from dcp producer for control_request correctly
    
    Change-Id: I24489dc1db1cde37d8e7b08811236b9a3f10298b
    aartamonau committed Nov 1, 2016
  4. Merge remote-tracking branch 'couchbase/3.x' into sherlock

    * couchbase/3.x:
      Revert dcp client changes.
      MB-21509 Always ack whatever is in the queue when removing it.
      MB-21509 Crash if close_stream returns unexpected error.
      MB-21509 [Backport] MB-21303 Handle race between stream addition and updater exit
      MB-21509 [Backport] MB-21303 Address leak in stream_info queue
      MB-21509 [Backport] MB-21303 Handle ack from dcp producer for control_request correctly
    
    Change-Id: I415d41675cb9ce463c18ade3ebf7d1a2d8cc54a6
    aartamonau committed Nov 1, 2016
  5. Revert dcp client changes.

    Because it still has bugs, just of a different kind. So reverting it
    back to a pristine state. Will fix on master.
    
    This reverts the following commits:
    
      37036aa
      57c534b
      63c71f0
      7990968
      6b43ef1
    
    Change-Id: I608e8bc0fce7f5de4e0d3bd433dd09ed2baf7b9e
    Reviewed-on: http://review.couchbase.org/69377
    Reviewed-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
    Tested-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
    aartamonau committed Nov 1, 2016
  6. Merge remote-tracking branch 'couchbase/3.x' into work

    * couchbase/3.x:
      MB-21509 Always ack whatever is in the queue when removing it.
      MB-21509 Crash if close_stream returns unexpected error.
    
    Change-Id: I5f3371f01575cac198134ceb8524e16d11fbb471
    aartamonau committed Nov 1, 2016
  7. Merge commit 'couchbase/3.x~2' into work

    * commit 'couchbase/3.x~2':
      MB-21509 [Backport] MB-21303 Handle race between stream addition and updater exit
      MB-21509 [Backport] MB-21303 Address leak in stream_info queue
      MB-21509 [Backport] MB-21303 Handle ack from dcp producer for control_request correctly
    
    Change-Id: I3054952dd3eb82ce904382f4976a3cb403724334
    aartamonau committed Nov 1, 2016
Commits on Oct 31, 2016
  1. MB-21509 Always ack whatever is in the queue when removing it.

    The problem with the original patch was that when the client got DOWN
    message from a process, it would just delete the queue without
    acknowledging anything.
    
    Now I just call check_and_send_buffer_ack from inside
    remove_request_queue. Incidentally, this means that it gets called
    even after the client just receives stream_end. And this means, that
    even if ep-engine continues sending mutations after stream_end, we'll
    still acknowledge them.
    
    Change-Id: I18f55f54deff30c0a914803869c3fe62d64f99f7
    Reviewed-on: http://review.couchbase.org/69349
    Well-Formed: buildbot <build@couchbase.com>
    Reviewed-by: Sarath Lakshman <sarath@couchbase.com>
    Tested-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
    aartamonau committed Oct 31, 2016
  2. MB-21509 Crash if close_stream returns unexpected error.

    It's much better than leaving the client in an undefined state.
    
    Change-Id: I76afddcb33ae7db25609b88517c64d6e1f2099f1
    Reviewed-on: http://review.couchbase.org/69348
    Well-Formed: buildbot <build@couchbase.com>
    Reviewed-by: Sarath Lakshman <sarath@couchbase.com>
    Tested-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
    aartamonau committed Oct 31, 2016
Commits on Oct 28, 2016
  1. MB-21509 [Backport] MB-21303 Handle race between stream addition and …

    …updater exit
    
    DocLoader sub-process adds dcp stream for a vbucket.
    Streams are added into active streams list after a response is
    received from dcp producer. If updater exits before the stream
    is added into active list, there is no way of closing this stream
    until updater is stopped in subsequent iteration, which could
    potentially result in not acknowledgeing any stream events for
    this vbucket.
    
    This patch avoids race by monitoring the DocLoader process and
    removes the streams whenevr the process terminates or the stream
    is explicitly closed.
    
    Change-Id: Ib36bb8d6fe0d07c220b16c231e2762d4dfeb33d9
    Reviewed-on: http://review.couchbase.org/68808
    Tested-by: Harsha H S <hhs.couchbase@gmail.com>
    Reviewed-by: Harsha H S <hhs.couchbase@gmail.com>
    Reviewed-on: http://review.couchbase.org/69315
    Reviewed-by: Sarath Lakshman <sarath@couchbase.com>
    Tested-by: Sarath Lakshman <sarath@couchbase.com>
    aartamonau committed with t3rm1n4l Oct 23, 2016
  2. MB-21509 [Backport] MB-21303 Address leak in stream_info queue

    In the error condition of add_stream, stream_info
    queue entry was not flushed out which resulted in leak.
    
    Change-Id: Id9358cc17a1b3ead45252bc61f18bf41e8d374ce
    Reviewed-on: http://review.couchbase.org/68565
    Tested-by: buildbot <build@couchbase.com>
    Reviewed-by: Abhishek Singh <abhishek@couchbase.com>
    Reviewed-on: http://review.couchbase.org/69314
    Reviewed-by: Sarath Lakshman <sarath@couchbase.com>
    Tested-by: Sarath Lakshman <sarath@couchbase.com>
    hsharsha committed with t3rm1n4l Oct 11, 2016
  3. MB-21509 [Backport] MB-21303 Handle ack from dcp producer for control…

    …_request correctly
    
    control_request for flow control buffer size is added into the
    pending request dictionary with nil as SendTo parameter as
    gen_server need not reply when it gets response from producer.
    This was not handled correctly when stream_response is handled
    in the client which is fixed in this patch.
    
    Change-Id: Ib382ddc9db3dc5da65d7a550d9b9ffa6ee375399
    Reviewed-on: http://review.couchbase.org/68525
    Reviewed-by: Dave Rigby <daver@couchbase.com>
    Reviewed-by: Abhishek Singh <abhishek@couchbase.com>
    Tested-by: Abhishek Singh <abhishek@couchbase.com>
    Tested-by: buildbot <build@couchbase.com>
    Reviewed-on: http://review.couchbase.org/69313
    Reviewed-by: Sarath Lakshman <sarath@couchbase.com>
    Tested-by: Sarath Lakshman <sarath@couchbase.com>
    hsharsha committed with t3rm1n4l Oct 10, 2016
Commits on Oct 24, 2016
  1. MB-21303 Handle race between stream addition and updater exit

    DocLoader sub-process adds dcp stream for a vbucket.
    Streams are added into active streams list after a response is
    received from dcp producer. If updater exits before the stream
    is added into active list, there is no way of closing this stream
    until updater is stopped in subsequent iteration, which could
    potentially result in not acknowledgeing any stream events for
    this vbucket.
    
    This patch avoids race by monitoring the DocLoader process and
    removes the streams whenevr the process terminates or the stream
    is explicitly closed.
    
    Change-Id: I9cf738460dbba8d6adf529764e816e2c5981484c
    Reviewed-on: http://review.couchbase.org/68808
    Tested-by: Harsha H S <hhs.couchbase@gmail.com>
    Reviewed-by: Harsha H S <hhs.couchbase@gmail.com>
    aartamonau committed with hsharsha Oct 23, 2016
Commits on Oct 21, 2016
  1. MB-21303 Address leak in stream_info queue

    In the error condition of add_stream, stream_info
    queue entry was not flushed out which resulted in leak.
    
    Change-Id: Ia499ea3d2c1f10b8dc990a8695dd7e4475354853
    Reviewed-on: http://review.couchbase.org/68565
    Tested-by: buildbot <build@couchbase.com>
    Reviewed-by: Abhishek Singh <abhishek@couchbase.com>
    hsharsha committed with hsharsha Oct 11, 2016
Commits on Oct 17, 2016
  1. MB-21303 Handle ack from dcp producer for control_request correctly

    control_request for flow control buffer size is added into the
    pending request dictionary with nil as SendTo parameter as
    gen_server need not reply when it gets response from producer.
    This was not handled correctly when stream_response is handled
    in the client which is fixed in this patch.
    
    Change-Id: I7afb11adbde79fe2ee0895feac8fec91d563a062
    Reviewed-on: http://review.couchbase.org/68525
    Reviewed-by: Dave Rigby <daver@couchbase.com>
    Reviewed-by: Abhishek Singh <abhishek@couchbase.com>
    Tested-by: Abhishek Singh <abhishek@couchbase.com>
    Tested-by: buildbot <build@couchbase.com>
    hsharsha committed with hsharsha Oct 10, 2016
Commits on Jun 30, 2016
  1. MB-16737 Set default timeout late

    The default timeout for internal scatter requests is 60s. It can be changed
    with the `connection_timeout` query parameter. For future changes it's needed
    to be able to distinguish the `connection_timeout` parameter being set at
    query time or not.
    
    Hence set the default value to `nil` and set it to the default value of
    60 seconds as late as possible.
    
    Change-Id: I45e7a2b07d27abb656150492e3a11985b77f901e
    Reviewed-on: http://review.couchbase.org/64651
    Tested-by: buildbot <build@couchbase.com>
    Reviewed-by: Abhishek Singh <abhishek@couchbase.com>
    Reviewed-by: Harsha H S <hhs.couchbase@gmail.com>
    vmx committed with vmx Jun 1, 2016
Commits on Jun 22, 2016
  1. Remove the `Timeout` variable which isn't used

    Change-Id: I50d1e8755de7986ae6a724540cc9e57856b0df11
    Reviewed-on: http://review.couchbase.org/64650
    Tested-by: buildbot <build@couchbase.com>
    Reviewed-by: Abhishek Singh <abhishek@couchbase.com>
    vmx committed with vmx Jun 1, 2016
Commits on Jun 13, 2016
  1. MB-19783 Use barrier to prevent exit of long running task

    There is a potential race in which terminator thread decides to
    terminate map reduce context and gets switched out of context.
    In the meantime map reduce task is finished normally and the same
    context is reused to perform map reduce for subsequent mutations.
    Now terminator thread will potentially terminate this new task,
    when it is scheduled back to run.
    This is avoided by using mutex in which either terminator thread,
    if successful will terminate long running map reduce task or the
    task is terminated normally.
    
    Change-Id: I6785a4f12155eab637e924290889284050e13888
    Reviewed-on: http://review.couchbase.org/64604
    Tested-by: buildbot <build@couchbase.com>
    Reviewed-by: Dave Finlay <dave.finlay@couchbase.com>
    Reviewed-by: Dave Rigby <daver@couchbase.com>
    Reviewed-by: Abhishek Singh <abhishek@couchbase.com>
    Reviewed-by: Volker Mische <volker.mische@gmail.com>
    hsharsha committed with hsharsha May 31, 2016
Commits on May 30, 2016
  1. Enable asserts in release builds

    Change-Id: I70a6a4afb1eaada643e9a70d33b43d5912f81d6b
    Reviewed-on: http://review.couchbase.org/64101
    Reviewed-by: Abhishek Singh <abhishek@couchbase.com>
    Tested-by: buildbot <build@couchbase.com>
    Reviewed-by: Volker Mische <volker.mische@gmail.com>
    hsharsha committed with hsharsha May 17, 2016
Commits on May 19, 2016
  1. Reference expected and received ddoc revision appropriately

    Change-Id: I12c4a22da7b98f3e8e6574579465532c849948ee
    Reviewed-on: http://review.couchbase.org/63923
    Reviewed-by: Volker Mische <volker.mische@gmail.com>
    Tested-by: buildbot <build@couchbase.com>
    Reviewed-by: Harsha H S <hhs.couchbase@gmail.com>
    abhi-bit committed May 11, 2016
Commits on May 17, 2016
  1. MB-16712 Stop group synchronously after master db deletion

    When the master database that contains the design documents is deleted,
    the corresponding view group is also stopped/removed.
    
    Previously that view group deletion was asynchronous. That lead to issues
    when the master database was deleted, but shortly afterwards recreated. If
    the view group didn't terminate fast enough (which was the case for the
    spatial views in the travel sample), calls to the view group ended up in
    the old group, instead of the newly created one.
    
    We now make a synchronous call to remove the group after the master deletion,
    to make sure the group got shutdown properly before any further requests
    can be initiated.
    
    Change-Id: Ib91b7000b31d9111b0cedf093de8e05c61956c1b
    Reviewed-on: http://review.couchbase.org/64029
    Reviewed-by: Harsha H S <hhs.couchbase@gmail.com>
    Tested-by: buildbot <build@couchbase.com>
    Reviewed-by: Abhishek Singh <abhishek@couchbase.com>
    vmx committed with vmx May 13, 2016
Commits on May 11, 2016
  1. MB-19502 Catch exceptions from jsonStringify function

    Reduce and emit functions did not handle exceptions thrown from
    jsonStringify, which resulted in bringing down of couchdb VM.
    This fix catches these exceptions and returns gracefully.
    
    Change-Id: I7455fe9f33d7f70e5cc9946bd59a8ece1c518633
    Reviewed-on: http://review.couchbase.org/63707
    Tested-by: buildbot <build@couchbase.com>
    Reviewed-by: Volker Mische <volker.mische@gmail.com>
    hsharsha committed with hsharsha May 4, 2016
  2. MB-19378 Handle memory leaks in context initialization

    Memory allocated dynamically was not freed in the catch clause,
    when exceptions happened. Also release resource if
    initialization fails.
    
    Change-Id: I4233a5104a03805beda09291f9a346f60379fdbb
    Reviewed-on: http://review.couchbase.org/63412
    Tested-by: buildbot <build@couchbase.com>
    Reviewed-by: Volker Mische <volker.mische@gmail.com>
    hsharsha committed with hsharsha Apr 27, 2016
  3. MB-19377 Handle collisions in context hash map

    Mapreduce contexts were stored in hash table and key was provided
    by erlang process to NIF using phash2 routine which is not
    collision resistent. This fix usues context address as key to
    avoid collision.
    
    Change-Id: I31defc4b1926022c9e649b8e2c7e11a8f4a56195
    Reviewed-on: http://review.couchbase.org/63318
    Reviewed-by: Dave Rigby <daver@couchbase.com>
    Tested-by: buildbot <build@couchbase.com>
    Reviewed-by: Volker Mische <volker.mische@gmail.com>
    hsharsha committed with hsharsha Apr 25, 2016
Commits on Apr 29, 2016
  1. Merge remote-tracking branch 'couchbase/watson' into master

    * couchbase/watson:
      MB-18985 Use platform APIs for thread creation and synchronization
      Increase DCP connection timeout for unit tests
    
    Change-Id: I4415f19c5b0b78c543a47c28e01451b18968ff7a
    vmx committed Apr 29, 2016
Commits on Apr 28, 2016
  1. MB-18985 Use platform APIs for thread creation and synchronization

    Platform APIs are compatible with NIF APIs for thread creation
    and synchronization. So mapreduce NIF uses platform APIs instead
    of C++11 primitivies to be compatible with NIF APIs.
    
    On Windows, mixing C++11 primitives with NIF APIs resulted in improper
    shutdown of erl.exe application in the unit tests which resulted in
    error popups at the exit of every unit test run.
    
    Change-Id: I002510632673ccbaee76f4f71b89526f00271dcd
    Reviewed-on: http://review.couchbase.org/63406
    Reviewed-by: Volker Mische <volker.mische@gmail.com>
    Reviewed-by: Dave Rigby <daver@couchbase.com>
    Reviewed-by: Abhishek Singh <abhishek@couchbase.com>
    Tested-by: Harsha H S <hhs.couchbase@gmail.com>
    Reviewed-by: Harsha H S <hhs.couchbase@gmail.com>
    hsharsha committed with hsharsha Apr 22, 2016
Commits on Apr 27, 2016
  1. Increase DCP connection timeout for unit tests

    The build slaves can be slow, hence set the DCP connection timeout
    high enough to prevent sporadic failures.
    
    Change-Id: I611da567980293d525dbc9ce44db929ef73b6e4c
    Reviewed-on: http://review.couchbase.org/63403
    Reviewed-by: Abhishek Singh <abhishek@couchbase.com>
    Tested-by: Abhishek Singh <abhishek@couchbase.com>
    Tested-by: buildbot <build@couchbase.com>
    vmx committed with vmx Apr 27, 2016
Commits on Apr 21, 2016
  1. Merge remote-tracking branch 'remotes/couchbase/watson' into master

    * remotes/couchbase/watson:
      MB-19245 Don't use fresh view group header
    
    Change-Id: Ie37ee0b93cae7054df1d1626e08e0ef550035cb8
    vmx committed Apr 21, 2016
  2. Merge remote-tracking branch 'remotes/couchbase/sherlock' into watson

    * remotes/origin/sherlock:
      MB-19245 Don't use fresh view group header
    
    Change-Id: Ibd01aeb820fe2e9e64f53bd3b5b506f71ea79dc5
    vmx committed Apr 21, 2016
  3. Fix log message formatting

    A log message was spanning to lines like:
    
        [info] [<0.518.0>] Updater for main set view group `_design/test`, set `couch_test_dcp_rollback` (prod), read a total
                      of 320 changes and doc_fields_used
    
    This changes it back to a single line:
    
        [info] [<0.286.0>] Updater for main set view group `_design/test`, set `couch_test_dcp_rollback` (prod), read a total of 255 changes and doc_fields_used
    
    Change-Id: I29883fa0e232cd59454982eb3897695068a0a5f4
    Reviewed-on: http://review.couchbase.org/63086
    Reviewed-by: Abhishek Singh <abhishek@couchbase.com>
    Reviewed-by: Harsha H S <hhs.couchbase@gmail.com>
    Tested-by: buildbot <build@couchbase.com>
    vmx committed with vmx Apr 20, 2016