Uploaded image for project: 'Couchbase Server'
  1. Couchbase Server
  2. MB-33852

[5.5.4] - Memcached returns NOT_STORED to client after trying to perform arithmetic operation

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • master, 6.5.0, 5.5.0, 5.5.3
    • 5.5.4
    • memcached
    • Untriaged
    • Yes

    Description

      [Cloned this from MB-33813 to track merging a fix for this issue to 5.5.4.]

      There is a race condition in ArithmeticCommandContext where a SET operation is performed between the ArithmeticCommandContext::getItem() and ArithmeticCommandContext::storeNewItem(), causing the call to bucket_store() to return ENGINE_NOT_STORED. Currently we just return this error to the memcached client however, this brakes the behaviour of this interface that existed before the refactoring of our arithmetic operations (see v4.5.0). Thus, we should resolve this race condition by trying to re-perform the arithmetic operation by resetting the ArithmeticCommandContext state machine.

      Attachments

        Issue Links

          For Gerrit Dashboard: MB-33852
          # Subject Branch Project Status CR V

          Activity

            dfinlay Dave Finlay created issue -
            dfinlay Dave Finlay made changes -
            Field Original Value New Value
            Description There is a race condition in {{ArithmeticCommandContext}} where a {{SET}} operation is performed between the {{ArithmeticCommandContext::getItem()}} and {{ArithmeticCommandContext::storeNewItem()}}, causing the call to {{bucket_store()}} to return {{ENGINE_NOT_STORED}}. Currently we just return this error to the memcached client however, this brakes the behaviour of this interface that existed before the refactoring of our arithmetic operations (see v4.5.0). Thus, we should resolve this race condition by trying to re-perform the arithmetic operation by resetting the {{ArithmeticCommandContext}} state machine.

            [Cloned this from MB-33813 to track merging a fix for this issue to 5.5.4.]

            There is a race condition in {{ArithmeticCommandContext}} where a {{SET}} operation is performed between the {{ArithmeticCommandContext::getItem()}} and {{ArithmeticCommandContext::storeNewItem()}}, causing the call to {{bucket_store()}} to return {{ENGINE_NOT_STORED}}. Currently we just return this error to the memcached client however, this brakes the behaviour of this interface that existed before the refactoring of our arithmetic operations (see v4.5.0). Thus, we should resolve this race condition by trying to re-perform the arithmetic operation by resetting the {{ArithmeticCommandContext}} state machine.

            dfinlay Dave Finlay made changes -
            Link This issue is a backport of MB-33813 [ MB-33813 ]
            dfinlay Dave Finlay made changes -
            Link This issue blocks MB-32627 [ MB-32627 ]
            dfinlay Dave Finlay made changes -
            Fix Version/s 5.5.4 [ 16003 ]
            Fix Version/s Mad-Hatter [ 15037 ]

            Build couchbase-server-5.5.4-4336 contains kv_engine commit 454186c with commit message:
            MB-33852: Fix NOT_STORED being returned from arithmetic op

            build-team Couchbase Build Team added a comment - Build couchbase-server-5.5.4-4336 contains kv_engine commit 454186c with commit message: MB-33852 : Fix NOT_STORED being returned from arithmetic op

            Marking resolved as the fix has been merged into couchbase/vulcan at commit 454186c6c9155e5fed62e0ce5d5082c7ed3a1e48 and has been built in coucbase-server-5.5.4-4336

            richard.demellow Richard deMellow added a comment - Marking resolved as the fix has been merged into couchbase/vulcan at commit 454186c6c9155e5fed62e0ce5d5082c7ed3a1e48 and has been built in coucbase-server-5.5.4-4336
            richard.demellow Richard deMellow made changes -
            Resolution Fixed [ 1 ]
            Status Open [ 1 ] Resolved [ 5 ]
            richard.demellow Richard deMellow made changes -
            Actual End 2019-04-18 05:01 (issue has been resolved)
            richard.demellow Richard deMellow made changes -
            Link This issue relates to CBSE-6638 [ CBSE-6638 ]

            Build couchbase-server-6.0.2-2365 contains kv_engine commit f4395e1 with commit message:
            MB-33854: Merge remote-tracking branch 'couchbase/vulcan' into alice

            build-team Couchbase Build Team added a comment - Build couchbase-server-6.0.2-2365 contains kv_engine commit f4395e1 with commit message: MB-33854 : Merge remote-tracking branch 'couchbase/vulcan' into alice

            Build couchbase-server-6.0.2-2365 contains kv_engine commit f4395e1 with commit message:
            MB-33854: Merge remote-tracking branch 'couchbase/vulcan' into alice

            build-team Couchbase Build Team added a comment - Build couchbase-server-6.0.2-2365 contains kv_engine commit f4395e1 with commit message: MB-33854 : Merge remote-tracking branch 'couchbase/vulcan' into alice

            Build couchbase-server-6.0.2-2365 contains kv_engine commit 454186c with commit message:
            MB-33852: Fix NOT_STORED being returned from arithmetic op

            build-team Couchbase Build Team added a comment - Build couchbase-server-6.0.2-2365 contains kv_engine commit 454186c with commit message: MB-33852 : Fix NOT_STORED being returned from arithmetic op
            arunkumar Arunkumar Senthilnathan (Inactive) made changes -
            Labels memcached memcached releasenote

            Build couchbase-server-6.5.0-3032 contains kv_engine commit cb3e3e7 with commit message:
            Merge remote-tracking branch 'couchbase/alice'

            build-team Couchbase Build Team added a comment - Build couchbase-server-6.5.0-3032 contains kv_engine commit cb3e3e7 with commit message: Merge remote-tracking branch 'couchbase/alice'

            Build couchbase-server-6.5.0-3032 contains kv_engine commit f4395e1 with commit message:
            MB-33854: Merge remote-tracking branch 'couchbase/vulcan' into alice

            build-team Couchbase Build Team added a comment - Build couchbase-server-6.5.0-3032 contains kv_engine commit f4395e1 with commit message: MB-33854 : Merge remote-tracking branch 'couchbase/vulcan' into alice

            Build couchbase-server-6.5.0-3032 contains kv_engine commit f4395e1 with commit message:
            MB-33854: Merge remote-tracking branch 'couchbase/vulcan' into alice

            build-team Couchbase Build Team added a comment - Build couchbase-server-6.5.0-3032 contains kv_engine commit f4395e1 with commit message: MB-33854 : Merge remote-tracking branch 'couchbase/vulcan' into alice

            Build couchbase-server-6.5.0-3032 contains kv_engine commit 454186c with commit message:
            MB-33852: Fix NOT_STORED being returned from arithmetic op

            build-team Couchbase Build Team added a comment - Build couchbase-server-6.5.0-3032 contains kv_engine commit 454186c with commit message: MB-33852 : Fix NOT_STORED being returned from arithmetic op

            regression looks good against 5.5.4 - closing this ticket

            arunkumar Arunkumar Senthilnathan (Inactive) added a comment - regression looks good against 5.5.4 - closing this ticket
            arunkumar Arunkumar Senthilnathan (Inactive) made changes -
            Status Resolved [ 5 ] Closed [ 6 ]

            People

              richard.demellow Richard deMellow
              richard.demellow Richard deMellow
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes

                  PagerDuty