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

4.2 unable to open properly downgraded 4.4 datafiles

    • Type: Icon: Bug Bug
    • Resolution: Duplicate
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 4.2.6
    • Component/s: None
    • Labels:
      None

      I've found two ways to trigger the following assertion on the tip of mongodb-4.2 (4c2230d922d5698d67be1c6b29be54ea3dde379d) when opening datafiles left behind by mongodb-4.4 (5b5d7988560a20dbe827a1fa16c0481e6c0e2821).

      The assertion:

      [1585840139:661667][10257:0x7ff5a069b740], wt, file:collection.wt, WT_SESSION.open_cursor: __wt_check_addr_validity, 156: an oldest start timestamp (0, 30) newer than its durable start timestamp (0, 0): WT_PANIC: WiredTiger library panic
      

      I believe these have the same root cause, but I wanted to make sure it was clear that MongoDB can arrive with these files in multiple paths that the server considers rather disparate. Following are two short-hand WT programs:

      Case 1, using use_timestamp=false on close:

          /* Sets `use_timestamps=<bool>` on WT_CONNECTION::close config/destruction. */                                                                     
          const bool useTimestampsAtShutdown = false;                                                                                                        
          WtConn conn("./WT_HOME_case1", "config_base=false", useTimestampsAtShutdown);                                                                      
          conn.setRelease("3.3");                                                                                                                            
          {                                                                                                                                                  
              WtSession session = conn.getSession();                                                                                                         
              invariantWTOKEasy(session.createTable(collTableUri));                                                                                          
              session.alterTableLogging(collTableUri, false);                                                                                                
          }                                                                                                                                                  
                                                                                                                                                             
          invariantWTOKEasy(conn.setOldestTimestamp(10));                                                                                                    
          invariantWTOKEasy(conn.setStableTimestamp(20));                                                                                                    
                                                                                                                                                             
          WtSession insertSession = conn.getSession();                                                                                                       
          insertSession.begin();                                                                                                                             
          WtCursor collCursor = insertSession.openCursor(collTableUri);                                                                                      
          collCursor.insert(0, 0);                                                                                                                           
          insertSession.setTimestamp(30);                                                                                                                    
          insertSession.commit();                                                                                                                            
      

      Case 2: use_timestamp=true on close where the last insert TS is < the updated stable TS:

          /* Sets `use_timestamps=<bool>` on WT_CONNECTION::close config/destruction. */                                                                     
          const bool useTimestampsAtShutdown = true;                                                                                                         
          WtConn conn("./WT_HOME_case2", "config_base=false", useTimestampsAtShutdown);                                                                      
          conn.setRelease("3.3");                                                                                                                            
          {                                                                                                                                                  
              WtSession session = conn.getSession();                                                                                                         
              invariantWTOKEasy(session.createTable(collTableUri));                                                                                          
              session.alterTableLogging(collTableUri, false);                                                                                                
          }                                                                                                                                                  
                                                                                                                                                             
          invariantWTOKEasy(conn.setOldestTimestamp(10));                                                                                                    
          invariantWTOKEasy(conn.setStableTimestamp(20));                                                                                                    
                                                                                                                                                             
          WtSession insertSession = conn.getSession();                                                                                                       
          insertSession.begin();                                                                                                                             
          WtCursor collCursor = insertSession.openCursor(collTableUri);                                                                                      
          collCursor.insert(0, 0);                                                                                                                           
          insertSession.setTimestamp(30);                                                                                                                    
          insertSession.commit();                                                                                                                            
                                                                                                                                                             
          conn.setStableTimestamp(40);                                                                                                                       
      

      Running the wt tool built on mongo-4.2 to dump the table:collection results in the following:

      dgottlieb@chimichurri ~/xgen/scratch$ ../wiredtiger42/wt -C "config_base=false" -h WT_HOME_case1 dump "table:collection"
      [1585840139:661667][10257:0x7ff5a069b740], wt, file:collection.wt, WT_SESSION.open_cursor: __wt_check_addr_validity, 156: an oldest start timestamp (0, 30) newer than its durable start timestamp (0, 0): WT_PANIC: WiredTiger library panic
      dgottlieb@chimichurri ~/xgen/scratch$ ../wiredtiger42/wt -C "config_base=false" -h WT_HOME_case2 dump "table:collection"
      [1585840143:958542][10284:0x7f9ee4809740], wt, file:collection.wt, WT_SESSION.open_cursor: __wt_check_addr_validity, 156: an oldest start timestamp (0, 30) newer than its durable start timestamp (0, 0): WT_PANIC: WiredTiger library panic
      

      Attached are the following for both cases:

      • unprocessed cpp programs to be linked against mongodb-4.4 that generate problematic datafies
      • the included include/wt_raii.h file needed to compile the unprocessed cpp files
      • Preprocessed versions of both programs
      • Data directories output by both programs that a 4.2 linked wt CLI program will be unable to dump.

            Assignee:
            backlog-server-storage-engines [DO NOT USE] Backlog - Storage Engines Team
            Reporter:
            daniel.gottlieb@mongodb.com Daniel Gottlieb (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: