Uploaded image for project: 'Phoenix'
  1. Phoenix
  2. PHOENIX-4092

Ensure index and table remains in sync when the table is mutating during index build

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Duplicate
    • None
    • None
    • None
    • None

    Description

      There's code in MetaDataClient.buildIndex() which runs a "catchup" query after the initial index population finishes to find any rows for inflight writes made while the population is taking place. This is meant to handle the case in which one client runs an UPSERT SELECT while another issues a CREATE INDEX. Since the UPSERT SELECT began before the CREATE INDEX, index maintenance will not be performed. The catchup query is meant to handle this scenario, though it makes an assumption that it can wait long enough for any such DML operations to complete prior to running the catchup query. Instead, we should have a mechanism to wait until all inflight DML operations on a table are complete.

      Note also that if an index is built asynchronously, there's no catchup query run at all.

      We should increase the testing we have around this scenario and deal with these corner cases. For one such test, see ImmutableIndexIT.testCreateIndexDuringUpsertSelect().

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              jamestaylor James R. Taylor
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: