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

Potential dead code in __rec_split_write

    • Type: Icon: Task Task
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None
    • Storage Engines
    • 3
    • StorEng - Defined Pipeline

      The __rec_split_write function is defined as shown below:

      static int
      __rec_split_write(WT_SESSION_IMPL *session, WT_RECONCILE *r, WT_REC_CHUNK *chunk,
        WT_ITEM *compressed_image, bool last_block)
      {
      

      The compressed_image arg seems to always be NULL in our code:

      src/reconcile/rec_write.c:1511:        WT_RET(__rec_split_write(session, r, r->cur_ptr, NULL, false));
      src/reconcile/rec_write.c:1514:            WT_RET(__rec_split_write(session, r, r->prev_ptr, NULL, false));
      src/reconcile/rec_write.c:1715:    return (__rec_split_write(session, r, r->prev_ptr, NULL, false));
      src/reconcile/rec_write.c:1768:            WT_RET(__rec_split_write(session, r, r->prev_ptr, NULL, false));
      src/reconcile/rec_write.c:1772:    return (__rec_split_write(session, r, r->cur_ptr, NULL, true));
      

      I am wondering if this a bug or just dead code.

            Assignee:
            backlog-server-storage-engines [DO NOT USE] Backlog - Storage Engines Team
            Reporter:
            etienne.petrel@mongodb.com Etienne Petrel
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: