Uploaded image for project: 'Confluence Data Center'
  1. Confluence Data Center
  2. CONFSERVER-79953

"Could not recover edge index, the system will attempt to do a full re-index" message on atlassian-confluence.log is causing confusion

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • High
    • 7.19.3, 7.20.2
    • 7.17.5, 7.19.2, 7.20.1
    • Search - Indexing
    • None

    Description

      Problem

      After rebuilding the index by scratch, Confluence doesn’t rebuild the edge index. Then, during Confluence startup, we have the following messages:

      2022-09-07 14:04:11,749 WARN [Catalina-utility-1] [confluence.impl.index.DefaultIndexRecoveryService] isIndexRecoveryRequired index recovery required! journal entry 2689875 not found for for edge_index
      2022-09-07 14:04:11,749 WARN [Catalina-utility-1] [confluence.impl.index.DefaultIndexRecoveryService] triggerIndexRecovererModuleDescriptors Index recovery is required for edge index, starting now
      2022-09-07 14:04:11,937 WARN [Catalina-utility-1] [confluence.impl.index.DefaultIndexRecoveryService] recoverIndexFromSharedHome unable to find entry 2689875 in the journal, journal_id is not up to date
      2022-09-07 14:04:21,975 WARN [Catalina-utility-1] [confluence.impl.index.DefaultIndexRecoveryService] recoverIndex Timeout waiting for index recovery, no other nodes responded to offer their index snapshot within 10 seconds. To increase this, modify the system property 'confluence.cluster.index.recovery.query.timeout' where the time unit is in seconds.
      2022-09-07 14:04:21,975 WARN [Catalina-utility-1] [confluence.impl.index.DefaultIndexRecoveryService] triggerIndexRecovererModuleDescriptors edge failed to recover, attempt 1/1
      2022-09-07 14:04:21,975 WARN [Catalina-utility-1] [confluence.impl.index.DefaultIndexRecoveryService] triggerIndexRecovererModuleDescriptors Could not recover edge index, the system will attempt to do a full re-index
      

      The last one (below) leads us to believe that a full re-index will be triggered, but it's not true.

      2022-09-07 14:04:21,975 WARN [Catalina-utility-1] [confluence.impl.index.DefaultIndexRecoveryService] triggerIndexRecovererModuleDescriptors Could not recover edge index, the system will attempt to do a full re-index
      

      Code Analysis

      Looking at the code, we can see that Confluence is doing a loop through each index type during the startup, which could be mainchange, and edge:

      for (IndexRecovererModuleDescriptor indexRecoverer : indexRecoverers) {
                  try {
                      JournalIdentifier journalId = indexRecoverer.getJournalId();
                      String indexDirName = indexRecoverer.getIndexDirName();
                      String indexName = indexRecoverer.getIndexName();
                      ...
        ------->      log.warn("Could not recover {} index, the system will attempt to do a full re-index", indexName);
                      // Run reindex for current node only
                      ReIndexingScopeThreadLocal.withScope(LOCALLY, () -> indexRecoverer.getModule().reindex());
                      ...
                  } catch (Exception e) {
                      log.error("Exception when handling index recovery for module descriptor {}", indexRecoverer.getCompleteKey(), e);
                  }
              }
      

      In short, the message is saying that Confluence is trying to recover the edge index only, but it's "failing" at this point since it still does not exist.

      Suggestion

      1. Re-build the edge index during a full re-index; or
      2. Change the "the system will attempt to do a full re-index" message to avoid confusion.

      Notes:

      Confluence is running into the warning due to it stopped updating the edge_index file in the /journal folder. If you're rebuilding the index from scratch, after removing the journal folder, Confluence will no regenerate the edge_index file in the file system. Meanwhile, please use the query below to verify the current state of edge_index in your database:

      select * from bandana where bandanakey='edge_index';
      
      select max(entry_id) from journalentry WHERE journal_name='edge_index';
      

      The value from both queries should be the same or close to each other.

      Attachments

        Issue Links

          Activity

            People

              ttranminh Tam Tran
              be7ad67acc61 Cristian Milani (Inactive)
              Votes:
              7 Vote for this issue
              Watchers:
              16 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: