Uploaded image for project: 'WiredTiger'
  1. WiredTiger
  2. WT-11923

Investigate the idea of specialised session to read checkpoint

    • Type: Icon: Improvement Improvement
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Checkpoints
    • StorEng - Defined Pipeline

      Currently, we allow any session to read a checkpoint at anytime. However, the cost is that we have to do the setups and checks for every cursor call with the code:

      #define WT_WITH_CHECKPOINT(session, cbt, op)                                                \
          do {                                                                                    \
              WT_TXN *__saved_txn;                                                                \
              uint64_t __saved_write_gen = (session)->checkpoint_write_gen;                       \
                                                                                                  \
              if ((cbt)->checkpoint_txn != NULL) {                                                \
                  __saved_txn = (session)->txn;                                                   \
                  if (F_ISSET(__saved_txn, WT_TXN_IS_CHECKPOINT)) {                               \
                      WT_ASSERT(                                                                  \
                        session, (cbt)->checkpoint_write_gen == (session)->checkpoint_write_gen); \
                      __saved_txn = NULL;                                                         \
                  } else {                                                                        \
                      (session)->txn = (cbt)->checkpoint_txn;                                     \
                      if ((cbt)->checkpoint_hs_dhandle != NULL) {                                 \
                          WT_ASSERT(session, (session)->hs_checkpoint == NULL);                   \
                          (session)->hs_checkpoint = (cbt)->checkpoint_hs_dhandle->checkpoint;    \
                      }                                                                           \
                      __saved_write_gen = (session)->checkpoint_write_gen;                        \
                      (session)->checkpoint_write_gen = (cbt)->checkpoint_write_gen;              \
                  }                                                                               \
              } else                                                                              \
                  __saved_txn = NULL;                                                             \
              op;                                                                                 \
              if (__saved_txn != NULL) {                                                          \
                  (session)->txn = __saved_txn;                                                   \
                  (session)->hs_checkpoint = NULL;                                                \
                  (session)->checkpoint_write_gen = __saved_write_gen;                            \
              }                                                                                   \
          } while (0)
      

      I don't see the reason why we cannot have a dedicated session to read the checkpoint. In this way, we can do this setup at the session level and remove this code for each cursor operation. This should speed up both the checkpoint read and normal transaction operations.

            Assignee:
            backlog-server-storage-engines [DO NOT USE] Backlog - Storage Engines Team
            Reporter:
            chenhao.qu@mongodb.com Chenhao Qu
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated: