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

HashTable numNonResident incorrect after bgFetch of StoredValue with state_deleted_key

    XMLWordPrintable

Details

    • Untriaged
    • Release Note
    • Unknown

    Description

      If a deleted document has its metadata restored back into the HashTable (for example via GET_META), and then the whole value is restored back (for example GET triggering a bgFetch), then the numNonResident count is incorrectly decremented, and can underflow.

      In more detail:

      1. GET_META("deleted_key") -> should result in HashTable state of:

        HashTable[0x104e0d818] with numInMemory:0 numDeleted:0 numNonResident:0 numTemp:1 values: 
             SV @0x104ee0740 X.. ..N. temp: D  seq:-3 rev:2 key:"ns:0 key_1" exp:1505929057 vallen:0
        

      2. GET("deleted_key") -> should then result in HashTable with numNonResident==0:

        HashTable[0x104e0d818] with numInMemory:0 numDeleted:0 numNonResident:0 numTemp:1 values: 
             SV @0x104ee0740 X.. WDNR temp:    seq:3 rev:3501 key:"ns:0 key_1" exp:4277009102 vallen:45 val:"'#_sync{"cas":"0xdeadbeefcafefeed <cut>"
        

      3. However we actually end up with a huge negative value:

        HashTable[0x104e0d818] with numInMemory:0 numDeleted:0 numNonResident:18446744073709551615 numTemp:1 values: 
             SV @0x104ee0740 X.. WDNR temp:    seq:3 rev:3501 key:"ns:0 key_1" exp:4277009102 vallen:45 val:"'#_sync{"cas":"0xdeadbeefcafefeed <cut>"
        

      Attachments

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

        Activity

          People

            bharath.gp Bharath G P
            drigby Dave Rigby (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              PagerDuty