Uploaded image for project: 'Apache IoTDB'
  1. Apache IoTDB
  2. IOTDB-2381

Deadlock caused by incorrect buffer pool size counter in VirtualStorageGroupProcessor

    XMLWordPrintableJSON

Details

    Description

      See the codes in VirtualStorageGroupProcessor https://github.com/apache/iotdb/blob/3d4bd3d0b5b59e3ca2e24c2a306d14b7e8c45902/server/src/main/java/org/apache/iotdb/db/engine/storagegroup/VirtualStorageGroupProcessor.java#L313-L328

      Here the counter currentWalPoolSize += 2 before the two allocations happen. However, if an OutOfMemoryError is thrown, at least one buffer array is null, and there's at most one currentWalPoolSize -= 1 executed.

      So the currentWalPoolSize will be incorrect, which may cause the thread wait in https://github.com/apache/iotdb/blob/3d4bd3d0b5b59e3ca2e24c2a306d14b7e8c45902/server/src/main/java/org/apache/iotdb/db/engine/storagegroup/VirtualStorageGroupProcessor.java#L293 forever.

      And another issue, ignoring the OutOfMemoryError is a VERY BAD choice, as it's a critical error in our environment and we should let DBA know it as soon as possible.

      Attachments

        Issue Links

          Activity

            People

              ericpai Eric Pai
              ericpai Eric Pai
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: