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

Magma rollback points differ to couchstore with checkpoint every batch

    XMLWordPrintable

Details

    • Bug
    • Resolution: User Error
    • Major
    • 7.1.0
    • 7.1.0
    • storage-engine
    • Untriaged
    • 1
    • Unknown

    Description

      Found with NexusKVStore. If we set the MagmaKVStoreConfig to checkpoint every batch (Sync(true) after every WriteDocs call) then the rollback points offered by magma don't quite make sense. In the case the max checkpoints is set to 5 and 2 appear to exist, one with seqno 10 and one with seqno 5. The rollback when run with NexusKVStore fails as couchstore can rollback to seqno 9 and magma only to seqno 5. I believe that with this config magma should be able to rollback to seqno 9 too.

      Unit test excerpt:

        setVBucketStateAndRunPersistTask(
              vbid,
              vbucket_state_active,
              {{"topology", nlohmann::json::array({{"active", "replica"}})}});
       
          for (int i = 0; i < 10; i++) {
              store_item(
                  vbid, makeStoredDocKey("key" + std::to_string(i)), "value");
              flushVBucketToDiskIfPersistent(vbid, 1);
          }
       
          setVBucketStateAndRunPersistTask(vbid, vbucket_state_replica);
       
          class RollbackCallback : public RollbackCB {
              void callback(GetValue& val) override {
              }
          };
       
          auto* kvstore = store->getRWUnderlying(vbid);
          auto rollbackResult = kvstore->rollback(
                  Vbid(0), 9, std::make_unique<RollbackCallback>());
      

      Attachments

        Issue Links

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

          Activity

            People

              ben.huddleston Ben Huddleston
              ben.huddleston Ben Huddleston
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes

                  PagerDuty