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

Investigate bounds for PagingVisitor expired items list

    XMLWordPrintable

Details

    • Task
    • Resolution: Unresolved
    • Major
    • Morpheus
    • None
    • couchbase-bucket
    • None
    • 1

    Description

      PagingVisitor, used by ItemPager and ExpiredItemPager to visit all stored values stored in the hashtable of each vbucket, may expire items found with an expiry time in the past.

      To do so outside of hashtable locks, the visitor accumulates expired items in a list:

      bool PagingVisitor::visit(const HashTable::HashBucketLock& lh, StoredValue& v) {
      ...
          if (isExpired) {
              std::unique_ptr<Item> it = v.toItem(currentBucket->getId());
              expired.push_back(*it.get());
              return true;
          }
      

      The items in this list are actually expired after the vbucket visit is done:

      void PagingVisitor::update() {
          store.deleteExpiredItems(expired, ExpireBy::Pager);
      

      However, with an expiry heavy workload, and a sizeable cluster, there could be a very large number of items collected in this list.

      Investigate whether this becomes an actual issue in real-world scenarios, and assess whether the size of this list should be capped. If found to be necessary, the accumulated items can then be expired when the limit is reached (ensuring that this still occurs outside of any hashtable locks) and the list emptied.

      Attachments

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

        Activity

          People

            owend Daniel Owen
            james.harrison James Harrison (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty