Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-24313

Not all callers of KVCatalog::FeatureTracker::getInfo() acquire resource lock when necessary

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.2.7, 3.3.8
    • Component/s: Storage
    • Labels:
    • Backwards Compatibility:
      Fully Compatible
    • Operating System:
      ALL
    • Backport Completed:
    • Steps To Reproduce:
      Hide
      1. Build mongod at commit f242be8.
      2. Start the mongod with --storageEngine=ephemeralForTest.

      [MongoDFixture:job0] 2016-05-28T10:34:06.970-0400 I -        [initandlisten] Invariant failure opCtx->lockState()->isLockHeldForMode(resourceIdCatalogMetadata, MODE_S) src/mongo/db/storage/kv/kv_catalog.cpp 275
      [MongoDFixture:job0] 2016-05-28T10:34:06.970-0400 I -        [initandlisten]
      [MongoDFixture:job0] 
      [MongoDFixture:job0] ***aborting after invariant() failure
      [MongoDFixture:job0] 
      [MongoDFixture:job0] 
      [MongoDFixture:job0] 2016-05-28T10:34:06.975-0400 F -        [initandlisten] Got signal: 6 (Aborted).
      [MongoDFixture:job0] 
      [MongoDFixture:job0]  0x12fe932 0x12fd859 0x12fe062 0x7ffea4a3bb10 0x7ffea4706265 0x7ffea4707d10 0x12946db 0xfc2707 0xfc427d 0xfcffcd 0x95cc01 0x95ee10 0x963ddd 0x7ffea46f3994 0x95b069
      [MongoDFixture:job0] ----- BEGIN BACKTRACE -----
      [MongoDFixture:job0] {"backtrace":[{"b":"400000","o":"EFE932","s":"_ZN5mongo15printStackTraceERSo"},{"b":"400000","o":"EFD859"},{"b":"400000","o":"EFE062"},{"b":"7FFEA4A2D000","o":"EB10"},{"b":"7FFEA46D6000","o":"30265","s":"gsignal"},{"b":"7FFEA46D6000","o":"31D10","s":"abort"},{"b":"400000","o":"E946DB","s":"_ZN5mongo15invariantFailedEPKcS1_j"},{"b":"400000","o":"BC2707","s":"_ZNK5mongo9KVCatalog14FeatureTracker7getInfoEPNS_16OperationContextE"},{"b":"400000","o":"BC427D","s":"_ZNK5mongo9KVCatalog14FeatureTracker26hasNoFeaturesMarkedAsInUseEPNS_16OperationContextE"},{"b":"400000","o":"BCFFCD","s":"_ZN5mongo15KVStorageEngine44requireDataFileCompatibilityWithPriorReleaseEPNS_16OperationContextE"},{"b":"400000","o":"55CC01"},{"b":"400000","o":"55EE10","s":"_ZN5mongo13initAndListenEi"},{"b":"400000","o":"563DDD","s":"main"},{"b":"7FFEA46D6000","o":"1D994","s":"__libc_start_main"},{"b":"400000","o":"55B069"}],"processInfo":{ "mongodbVersion" : "3.2.6-53-gf242be8", "gitVersion" : "f242be85e80794d009eb151c9ea2184ceb8d3d81", "compiledModules" : [], "uname" : { "sysname" : "Linux", "release" : "2.6.32-431.3.1.el6.x86_64", "version" : "#1 SMP Fri Jan 3 21:39:27 UTC 2014", "machine" : "x86_64" }, "somap" : [ { "elfType" : 2, "b" : "400000" }, { "b" : "7FFF0A6FF000", "elfType" : 3 }, { "b" : "7FFEA52DD000", "path" : "/lib64/librt.so.1", "elfType" : 3 }, { "b" : "7FFEA50D9000", "path" : "/lib64/libdl.so.2", "elfType" : 3 }, { "b" : "7FFEA4E56000", "path" : "/lib64/libm.so.6", "elfType" : 3 }, { "b" : "7FFEA4C48000", "path" : "/lib64/libgcc_s.so.1", "elfType" : 3 }, { "b" : "7FFEA4A2D000", "path" : "/lib64/libpthread.so.0", "elfType" : 3 }, { "b" : "7FFEA46D6000", "path" : "/lib64/libc.so.6", "elfType" : 3 }, { "b" : "7FFEA54E6000", "path" : "/lib64/ld-linux-x86-64.so.2", "elfType" : 3 } ] }}
      [MongoDFixture:job0]  mongod(_ZN5mongo15printStackTraceERSo+0x32) [0x12fe932]
      [MongoDFixture:job0]  mongod(+0xEFD859) [0x12fd859]
      [MongoDFixture:job0]  mongod(+0xEFE062) [0x12fe062]
      [MongoDFixture:job0]  libpthread.so.0(+0xEB10) [0x7ffea4a3bb10]
      [MongoDFixture:job0]  libc.so.6(gsignal+0x35) [0x7ffea4706265]
      [MongoDFixture:job0]  libc.so.6(abort+0x110) [0x7ffea4707d10]
      [MongoDFixture:job0]  mongod(_ZN5mongo15invariantFailedEPKcS1_j+0xCB) [0x12946db]
      [MongoDFixture:job0]  mongod(_ZNK5mongo9KVCatalog14FeatureTracker7getInfoEPNS_16OperationContextE+0x497) [0xfc2707]
      [MongoDFixture:job0]  mongod(_ZNK5mongo9KVCatalog14FeatureTracker26hasNoFeaturesMarkedAsInUseEPNS_16OperationContextE+0x1D) [0xfc427d]
      [MongoDFixture:job0]  mongod(_ZN5mongo15KVStorageEngine44requireDataFileCompatibilityWithPriorReleaseEPNS_16OperationContextE+0x5D) [0xfcffcd]
      [MongoDFixture:job0]  mongod(+0x55CC01) [0x95cc01]
      [MongoDFixture:job0]  mongod(_ZN5mongo13initAndListenEi+0x930) [0x95ee10]
      [MongoDFixture:job0]  mongod(main+0x15D) [0x963ddd]
      [MongoDFixture:job0]  libc.so.6(__libc_start_main+0xF4) [0x7ffea46f3994]
      [MongoDFixture:job0]  mongod(+0x55B069) [0x95b069]
      [MongoDFixture:job0] -----  END BACKTRACE  -----
      

      Show
      Build mongod at commit f242be8 . Start the mongod with --storageEngine=ephemeralForTest . [MongoDFixture:job0] 2016-05-28T10:34:06.970-0400 I - [initandlisten] Invariant failure opCtx->lockState()->isLockHeldForMode(resourceIdCatalogMetadata, MODE_S) src/mongo/db/storage/kv/kv_catalog.cpp 275 [MongoDFixture:job0] 2016-05-28T10:34:06.970-0400 I - [initandlisten] [MongoDFixture:job0] [MongoDFixture:job0] ***aborting after invariant() failure [MongoDFixture:job0] [MongoDFixture:job0] [MongoDFixture:job0] 2016-05-28T10:34:06.975-0400 F - [initandlisten] Got signal: 6 (Aborted). [MongoDFixture:job0] [MongoDFixture:job0] 0x12fe932 0x12fd859 0x12fe062 0x7ffea4a3bb10 0x7ffea4706265 0x7ffea4707d10 0x12946db 0xfc2707 0xfc427d 0xfcffcd 0x95cc01 0x95ee10 0x963ddd 0x7ffea46f3994 0x95b069 [MongoDFixture:job0] ----- BEGIN BACKTRACE ----- [MongoDFixture:job0] {"backtrace":[{"b":"400000","o":"EFE932","s":"_ZN5mongo15printStackTraceERSo"},{"b":"400000","o":"EFD859"},{"b":"400000","o":"EFE062"},{"b":"7FFEA4A2D000","o":"EB10"},{"b":"7FFEA46D6000","o":"30265","s":"gsignal"},{"b":"7FFEA46D6000","o":"31D10","s":"abort"},{"b":"400000","o":"E946DB","s":"_ZN5mongo15invariantFailedEPKcS1_j"},{"b":"400000","o":"BC2707","s":"_ZNK5mongo9KVCatalog14FeatureTracker7getInfoEPNS_16OperationContextE"},{"b":"400000","o":"BC427D","s":"_ZNK5mongo9KVCatalog14FeatureTracker26hasNoFeaturesMarkedAsInUseEPNS_16OperationContextE"},{"b":"400000","o":"BCFFCD","s":"_ZN5mongo15KVStorageEngine44requireDataFileCompatibilityWithPriorReleaseEPNS_16OperationContextE"},{"b":"400000","o":"55CC01"},{"b":"400000","o":"55EE10","s":"_ZN5mongo13initAndListenEi"},{"b":"400000","o":"563DDD","s":"main"},{"b":"7FFEA46D6000","o":"1D994","s":"__libc_start_main"},{"b":"400000","o":"55B069"}],"processInfo":{ "mongodbVersion" : "3.2.6-53-gf242be8", "gitVersion" : "f242be85e80794d009eb151c9ea2184ceb8d3d81", "compiledModules" : [], "uname" : { "sysname" : "Linux", "release" : "2.6.32-431.3.1.el6.x86_64", "version" : "#1 SMP Fri Jan 3 21:39:27 UTC 2014", "machine" : "x86_64" }, "somap" : [ { "elfType" : 2, "b" : "400000" }, { "b" : "7FFF0A6FF000", "elfType" : 3 }, { "b" : "7FFEA52DD000", "path" : "/lib64/librt.so.1", "elfType" : 3 }, { "b" : "7FFEA50D9000", "path" : "/lib64/libdl.so.2", "elfType" : 3 }, { "b" : "7FFEA4E56000", "path" : "/lib64/libm.so.6", "elfType" : 3 }, { "b" : "7FFEA4C48000", "path" : "/lib64/libgcc_s.so.1", "elfType" : 3 }, { "b" : "7FFEA4A2D000", "path" : "/lib64/libpthread.so.0", "elfType" : 3 }, { "b" : "7FFEA46D6000", "path" : "/lib64/libc.so.6", "elfType" : 3 }, { "b" : "7FFEA54E6000", "path" : "/lib64/ld-linux-x86-64.so.2", "elfType" : 3 } ] }} [MongoDFixture:job0] mongod(_ZN5mongo15printStackTraceERSo+0x32) [0x12fe932] [MongoDFixture:job0] mongod(+0xEFD859) [0x12fd859] [MongoDFixture:job0] mongod(+0xEFE062) [0x12fe062] [MongoDFixture:job0] libpthread.so.0(+0xEB10) [0x7ffea4a3bb10] [MongoDFixture:job0] libc.so.6(gsignal+0x35) [0x7ffea4706265] [MongoDFixture:job0] libc.so.6(abort+0x110) [0x7ffea4707d10] [MongoDFixture:job0] mongod(_ZN5mongo15invariantFailedEPKcS1_j+0xCB) [0x12946db] [MongoDFixture:job0] mongod(_ZNK5mongo9KVCatalog14FeatureTracker7getInfoEPNS_16OperationContextE+0x497) [0xfc2707] [MongoDFixture:job0] mongod(_ZNK5mongo9KVCatalog14FeatureTracker26hasNoFeaturesMarkedAsInUseEPNS_16OperationContextE+0x1D) [0xfc427d] [MongoDFixture:job0] mongod(_ZN5mongo15KVStorageEngine44requireDataFileCompatibilityWithPriorReleaseEPNS_16OperationContextE+0x5D) [0xfcffcd] [MongoDFixture:job0] mongod(+0x55CC01) [0x95cc01] [MongoDFixture:job0] mongod(_ZN5mongo13initAndListenEi+0x930) [0x95ee10] [MongoDFixture:job0] mongod(main+0x15D) [0x963ddd] [MongoDFixture:job0] libc.so.6(__libc_start_main+0xF4) [0x7ffea46f3994] [MongoDFixture:job0] mongod(+0x55B069) [0x95b069] [MongoDFixture:job0] ----- END BACKTRACE -----
    • Sprint:
      Query 15 (06/03/16)

      Description

      A resource lock on resourceIdCatalogMetadata needs to be acquired when the storage engine doesn't support document-level concurrency because the record store underlying the KVCatalog isn't thread-safe.

      This issue only affects KV storage engines that don't support document-level concurrency. The only known such storage engine is ephemeralForTest.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: