Uploaded image for project: 'Ignite'
  1. Ignite
  2. IGNITE-18203

Table/index dependecy deadlock on node restart

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Blocker
    • Resolution: Fixed
    • None
    • 3.0
    • None

    Description

      Currently, index depends on a table, while table depends on RAFT groups start, which may need to apply commands (including inserts), and inserts depend on indices of the table. There is a dependency cycle. This is just one example of such a cycle in the current design.

      One idea is to split 'Table' entity into 2: 'Table Structure' and 'Full Table'. Table structure would only comprise objects representing bare table information (no indices), something like current TableImpl/InternalTable. Then, the following dependencies could be created:

      1. Table Structure depends on Configuration
      2. Index depends on Configuration and Table Structure
      3. Sql Schema depends on Table Structure and Index
      4. Full Table depends on Table Structure, Index, Sql Schema

      This requires a redesign of how TableManager, IndexManager, SqlSchemaManager interact, probably TableManager needs to be broken in 2.

       

      Upd

      I've tried to redesign the TableManager in order to split the table into two parts: schema based "client" one (used by indeces, etc) and the one that assumes starting server endpoints. Unfortunately I didn't succeed in it. We will have one more attempt within distribution zone collocation related issues. Thus in order to fix the deadlock I've proposed rather crappy solution with async raft log application on restart based on the latch that bind PartitionReplicaListener.invoke and NodeImpl together. Ugly one that hopefully will be eliminated in the future.

      Ticket was renamed:

      "Redesign table/index creation to avoid dependency cycles" -> "Table/index dependecy deadlock on node restart"

      Attachments

        Issue Links

          Activity

            People

              alapin Alexander Lapin
              rpuch Roman Puchkovskiy
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 1h 40m
                  1h 40m