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

Fix history store truncate function on partial restore or non-timestamp tables

    • 5
    • Storage - Ra 2022-03-21, Storage - Ra 2022-04-04

      I pulled WT-8703 into MongoDB on commit 00553eb23389a3213f384835b5c7d821a0bde1b4 and ran into this WiredTiger error during the wiredtiger_open() call:

      {"t":{"$date":"2022-03-14T14:42:34.330+00:00"},"s":"I",  "c":"STORAGE",  "id":22315,   "ctx":"initandlisten","msg":"Opening WiredTiger","attr":{"config":"create,cache_size=31249M,session_max=33000,eviction=(threads_min=4,threads_max=4),config_base=false,statistics=(fast),log=(enabled=true,archive=true,path=journal,compressor=snappy),builtin_extension_config=(zstd=(compression_level=6)),file_manager=(close_idle_time=600,close_scan_interval=10,close_handle_minimum=2000),statistics_log=(wait=0),json_output=(error,message),verbose=[recovery_progress:1,checkpoint_progress:1,compact_progress:1,backup:0,checkpoint:0,compact:0,evict:0,history_store:0,recovery:0,rts:0,salvage:0,tiered:0,timestamp:0,transaction:0,verify:0,log:0],debug_mode=(corruption_abort=false,),backup_restore_target=[table:collection-27--878280714822421814,table:_mdb_catalog,table:collection-4--878280714822421814,table:collection-39--878280714822421814,table:index-11--878280714822421814,table:collection-8--878280714822421814,table:collection-34--878280714822421814,table:index-5--878280714822421814,table:index-33--878280714822421814,table:index-1--878280714822421814,table:index-3--878280714822421814,table:collection-12--878280714822421814,table:collection-17--878280714822421814,table:sizeStorer,table:collection-28--878280714822421814,table:collection-14--878280714822421814,table:collection-26--878280714822421814,table:index-20--878280714822421814,table:collection-0--878280714822421814,table:collection-15--878280714822421814,table:collection-22--878280714822421814,table:index-21--878280714822421814,table:index-29--878280714822421814,table:index-42--878280714822421814,table:index-25--878280714822421814,table:collection-10--878280714822421814,table:index-36--878280714822421814,table:collection-24--878280714822421814,table:internal-44--878280714822421814,table:index-13--878280714822421814,table:index-16--878280714822421814,table:index-32--878280714822421814,table:index-40--878280714822421814,table:collection-6--878280714822421814,table:index-9--878280714822421814,table:index-23--878280714822421814,table:collection-41--878280714822421814,table:index-30--878280714822421814,table:index-31--878280714822421814,table:index-7--878280714822421814,table:collection-19--878280714822421814,table:collection-2--878280714822421814,table:index-35--878280714822421814,table:index-18--878280714822421814,],"}}
      {"t":{"$date":"2022-03-14T14:42:35.083+00:00"},"s":"E",  "c":"WT",       "id":22435,   "ctx":"initandlisten","msg":"WiredTiger error message","attr":{"error":0,"message":{"ts_sec":1647268955,"ts_usec":83637,"thread":"5849:0x7fad1b1d91c0","session_dhandle_name":"file:WiredTigerHS.wt","session_name":"WT_CURSOR.search_near","category":"WT_VERB_DEFAULT","category_id":9,"verbose_level":"ERROR","verbose_level_id":-3,"msg":"int __curhs_next_visible(WT_SESSION_IMPL *, WT_CURSOR_HS *):547:F_ISSET(session->txn, WT_TXN_HAS_SNAPSHOT)"}}}
      {"t":{"$date":"2022-03-14T14:42:35.084+00:00"},"s":"E",  "c":"WT",       "id":22435,   "ctx":"initandlisten","msg":"WiredTiger error message","attr":{"error":0,"message":{"ts_sec":1647268955,"ts_usec":83981,"thread":"5849:0x7fad1b1d91c0","session_dhandle_name":"file:WiredTigerHS.wt","session_name":"WT_CURSOR.search_near","category":"WT_VERB_DEFAULT","category_id":9,"verbose_level":"ERROR","verbose_level_id":-3,"msg":"void __wt_abort(WT_SESSION_IMPL *):28:aborting WiredTiger library"}}}
      

      Here's the stacktrace:

      /home/ubuntu/MongoDB/mongo/src/mongo/util/stacktrace_posix.cpp:263:21: mongo::stack_trace_detail::(anonymous namespace)::LibunwindStepIteration::LibunwindStepIteration(mongo::StackTraceSink&)
      /home/ubuntu/MongoDB/mongo/src/mongo/util/stacktrace_posix.cpp:435:5: mongo::stack_trace_detail::(anonymous namespace)::printStackTraceImpl(mongo::stack_trace_detail::(anonymous namespace)::Options const&, mongo::StackTraceSink*)
      /home/ubuntu/MongoDB/mongo/src/mongo/util/stacktrace_posix.cpp:485:5: mongo::printStackTrace()
      /home/ubuntu/MongoDB/mongo/src/mongo/util/signal_handlers_synchronous.cpp:209:5: mongo::(anonymous namespace)::printSignalAndBacktrace(int)
      /home/ubuntu/MongoDB/mongo/src/mongo/util/signal_handlers_synchronous.cpp:232:5: abruptQuit
      /home/ubuntu/MongoDB/mongo/src/mongo/util/signal_handlers_synchronous.cpp:266:5: abruptQuitAction
      ??:0:0: ??
      /build/glibc-2ORdQG/glibc-2.27/signal/../sysdeps/unix/sysv/linux/nptl-signals.h:80:0: __libc_signal_restore_set
      /build/glibc-2ORdQG/glibc-2.27/signal/../sysdeps/unix/sysv/linux/raise.c:48:0: gsignal
      /build/glibc-2ORdQG/glibc-2.27/stdlib/abort.c:79:0: abort
      /home/ubuntu/MongoDB/mongo/src/third_party/wiredtiger/src/os_common/os_abort.c:30:5: __wt_abort
      /home/ubuntu/MongoDB/mongo/src/third_party/wiredtiger/src/cursor/cur_hs.c:547:9: __curhs_next_visible
      /home/ubuntu/MongoDB/mongo/src/third_party/wiredtiger/src/cursor/cur_hs.c:675:9: __curhs_search_near
      /home/ubuntu/MongoDB/mongo/src/third_party/wiredtiger/src/cursor/cur_hs.c:598:5: __curhs_search_near_helper
      /home/ubuntu/MongoDB/mongo/src/third_party/wiredtiger/src/cursor/cur_hs.c:582:13: __wt_curhs_search_near_after
      /home/ubuntu/MongoDB/mongo/src/third_party/wiredtiger/src/txn/txn_rollback_to_stable.c:1438:11: __rollback_to_stable_btree_hs_truncate
      /home/ubuntu/MongoDB/mongo/src/third_party/wiredtiger/src/txn/txn_rollback_to_stable.c:1539:13: __rollback_to_stable_hs_final_pass
      /home/ubuntu/MongoDB/mongo/src/third_party/wiredtiger/src/txn/txn_rollback_to_stable.c:1810:9: __rollback_to_stable_btree_apply_all
      /home/ubuntu/MongoDB/mongo/src/third_party/wiredtiger/src/txn/txn_rollback_to_stable.c:1859:5: __rollback_to_stable
      /home/ubuntu/MongoDB/mongo/src/third_party/wiredtiger/src/txn/txn_rollback_to_stable.c:1899:5: __wt_rollback_to_stable
      /home/ubuntu/MongoDB/mongo/src/third_party/wiredtiger/src/txn/txn_recover.c:1047:9: __wt_txn_recover
      /home/ubuntu/MongoDB/mongo/src/third_party/wiredtiger/src/conn/conn_open.c:223:5: __wt_connection_workers
      /home/ubuntu/MongoDB/mongo/src/third_party/wiredtiger/src/conn/conn_api.c:3014:5: wiredtiger_open
      /home/ubuntu/MongoDB/mongo/src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp:665:15: mongo::WiredTigerKVEngine::_openWiredTiger(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)
      /home/ubuntu/MongoDB/mongo/src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp:466:5: mongo::WiredTigerKVEngine::WiredTigerKVEngine(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, mongo::ClockSource*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned long, unsigned long, bool, bool, bool, bool)
      /opt/mongodbtoolchain/revisions/39699409944dd532c7cbdce2f62da11361ac220a/stow/gcc-v3.Me0/lib/gcc/x86_64-mongodb-linux/8.2.0/../../../../include/c++/8.2.0/bits/unique_ptr.h:831:34: std::_MakeUniq<mongo::WiredTigerKVEngine>::__single_object std::make_unique<mongo::WiredTigerKVEngine, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, mongo::ClockSource*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, unsigned long&, unsigned long, bool const&, bool const&, bool const&, bool const&>(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, mongo::ClockSource*&&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, unsigned long&, unsigned long&&, bool const&, bool const&, bool const&, bool const&)
      /home/ubuntu/MongoDB/mongo/src/mongo/db/storage/wiredtiger/wiredtiger_init.cpp:121:13: mongo::(anonymous namespace)::WiredTigerFactory::create(mongo::OperationContext*, mongo::StorageGlobalParams const&, mongo::StorageEngineLockFile const*) const
      /home/ubuntu/MongoDB/mongo/src/mongo/db/storage/storage_engine_init.cpp:169:22: mongo::initializeStorageEngine(mongo::OperationContext*, mongo::StorageEngineInitFlags)
      /home/ubuntu/MongoDB/mongo/src/mongo/db/mongod_main.cpp:422:30: mongo::(anonymous namespace)::_initAndListen(mongo::ServiceContext*, int)
      /home/ubuntu/MongoDB/mongo/src/mongo/db/mongod_main.cpp:857:16: mongo::(anonymous namespace)::initAndListen(mongo::ServiceContext*, int)
      /home/ubuntu/MongoDB/mongo/src/mongo/db/mongod_main.cpp:1557:25: mongo::mongod_main(int, char**)
      

      I've attached original.tar.gz, which is the database that the backup was taken on, and backup.tar.gz, which is the backup prior to running MongoDB on it and getting the above error.

      The following tables were not backed up:

      • collection-37--878280714822421814.wt
      • index-38--878280714822421814.wt
      • index-43--878280714822421814.wt

        1. backup.tar.gz
          143 kB
        2. original.tar.gz
          508 kB

            Assignee:
            jie.chen@mongodb.com Jie Chen
            Reporter:
            gregory.wlodarek@mongodb.com Gregory Wlodarek
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: