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

Expired items are not excluded from production/dev views until expiry pager runs ( which deletes the items from database permanently )

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.0
    • Component/s: None
    • Security Level: Public
    • Environment:

      Description

      Expired items are not excluded from production/dev views. This happens only after the item is "get".

      Steps to reproduce:

      1. Create default bucket and create 1 production view
      curl -X PUT -H 'Content-Type: application/json' 'http://Administrator:asdasd@127.0.0.1:9500/default/_design/d1' -d '{"views":{"v1":{"map":"function(doc,meta)

      {\nemit(meta.id,doc);\n}

      "}}}'

      {"ok":true,"id":"_design/d1"}

      2. Insert 2 items from memcached client with expiry set to 5 seconds

      >>> import mc_bin_client
      >>> mc = mc_bin_client.MemcachedClient(port=12001)
      >>> mc.set("ab", 5, 0, "val")
      (3306888435, 7973028514358, '')
      >>> mc.set("ab1", 5, 0, "val")
      (2896330942, 7997559610975, '')

      3. Query the view with stale=false to build the index
      curl -X GET 'http://127.0.0.1:9500/default/_design/d1/_view/v1?stale=false'
      {"total_rows":2,"rows":[

      {"id":"ab","key":"ab","value":"dmFs"}

      ,

      {"id":"ab1","key":"ab1","value":"dmFs"}

      ]
      }

      4. Query the view after couple of minutes and expired items are still returned
      curl -X GET 'http://127.0.0.1:9500/default/_design/d1/_view/v1?stale=false'
      {"total_rows":2,"rows":[

      {"id":"ab","key":"ab","value":"dmFs"}

      ,

      {"id":"ab1","key":"ab1","value":"dmFs"}

      ]
      }

      If memcached get is used with these items, then these are excluded from the views. Otherwise these are always returned in view results.

      Diagnostic is attached.

      Checked with Mike on this and ep-engine seems to be doing things correctly:

      "This does look like an issue, but not in the ep-engine side. Since ep-engine might take an hour to actually remove an expired item, it should be up to the view engine to filter out any expired items too. The reaon why doing a get will cause the item to disappear from the view results is that ep-engine will actually do the deletion."

      No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

        deepkaran.salooja Deepkaran Salooja created issue -
        FilipeManana Filipe Manana (Inactive) made changes -
        Field Original Value New Value
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Won't Fix [ 2 ]
        farshid Farshid Ghods (Inactive) made changes -
        Resolution Won't Fix [ 2 ]
        Status Resolved [ 5 ] Reopened [ 4 ]
        Assignee Filipe Manana [ filipemanana ] MC Brown [ mccouch ]
        farshid Farshid Ghods (Inactive) made changes -
        Summary Expired items are not excluded from production/dev views Expired items are not excluded from production/dev views until expiry pager runs ( which deletes the items from database permanently )
        Component/s documentation [ 10012 ]
        Component/s view-engine [ 10060 ]
        farshid Farshid Ghods (Inactive) made changes -
        Labels 2.0-release-notes
        Affects Version/s recent-builds-2.0 [ 10349 ]
        dipti Dipti Borkar made changes -
        Assignee MC Brown [ mccouch ] Rahim Yaseen [ yaseen ]
        Priority Major [ 3 ] Blocker [ 1 ]
        farshid Farshid Ghods (Inactive) made changes -
        Assignee Rahim Yaseen [ yaseen ] Steve Yen [ steve ]
        farshid Farshid Ghods (Inactive) made changes -
        Assignee Steve Yen [ steve ] Rahim Yaseen [ yaseen ]
        dipti Dipti Borkar made changes -
        Component/s view-engine [ 10060 ]
        Component/s documentation [ 10012 ]
        steve Steve Yen made changes -
        Assignee Rahim Yaseen [ yaseen ] MC Brown [ mccouch ]
        Component/s documentation [ 10012 ]
        Component/s view-engine [ 10060 ]
        mccouch MC Brown (Inactive) made changes -
        Status Reopened [ 4 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        deepkaran.salooja Deepkaran Salooja made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        wayne Wayne Siu made changes -
        Component/s documentation-don't-use-put-in-doc-project [ 10012 ]

          People

          • Assignee:
            mccouch MC Brown (Inactive)
            Reporter:
            deepkaran.salooja Deepkaran Salooja
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Gerrit Reviews

              There are no open Gerrit changes