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

Callers of WT_WITH_HOTBACKUP_READ macros don't need to check backup status

    • Type: Icon: Technical Debt Technical Debt
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Lint
    • Storage Engines
    • StorEng - Defined Pipeline

      While working on WT-13502 I took a close look at the WT_WITH_HOTBACKUP_READ_LOCK macro and its users. The WT_WITH_HOTBACKUP_READ_LOCK macro already checks that a backup is not in progress, someone should evaluate whether the caller needs to do so also.

      Most uses are like this (from block/block_write.c:

          if (__wt_atomic_load64(&conn->hot_backup_start) == 0)
              WT_WITH_HOTBACKUP_READ_LOCK(session, ret = __wt_ftruncate(session, block->fh, len), NULL);
      

      On one hand, we can correctly remove the conditional completely and avoid that atomic load. On the other hand, we trade skipping the atomic load with acquiring the read lock unconditionally.

            Assignee:
            backlog-server-storage-engines [DO NOT USE] Backlog - Storage Engines Team
            Reporter:
            sue.loverso@mongodb.com Susan LoVerso
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: