Uploaded image for project: 'IMPALA'
  1. IMPALA
  2. IMPALA-11721

Impala query keep being retried over frequently updated iceberg table

    XMLWordPrintableJSON

Details

    • ghx-label-13

    Description

      Iceberg table loading can fail in local catalog mode if the table gets updated frequently.

      This is what happens during table loading in local catalog mode:

      Every query starts with it's own empty local catalog. Table metadata is fetched in multiple requests via a MetaProvider which is always a CatalogdMetaprovider. CatalogdMetaprovider caches requests and the cache key also includes the table's catalog version.

      The Iceberg table is loaded by the following requests:

      1. CatalogdMetaProvider.loadTable()
      2. CatalogdMetaProvider.loadIcebergTable()
      3. CatalogdMetaProvider.loadIcebergApiTable() # This actually directly loads the Iceberg table via Iceberg API (no CatalogD involved)
      4. CatalogdMetaProvider.loadTableColumnStatistics()
      5. CatalogdMetaProvider.loadPartitionList()
      6. CatalogdMetaProvider.loadPartitionsByRefs()

      Steps 1-4 happens during table loading, steps 5-6 happens during planning. We cannot really reorder these invocations, but since CatalogdMetaprovider caches these, only the very first invocations need to reach out to CatalogD and check the table's catalot version. Subsequent invocations, i.e. subsequent queries that use the Iceberg table can use the cached metadata, and no need to check the catalog version of the cached metadata since the cache key also includes the catalog version.

      I see two things that could resolve the issue:

      1. speedup loadIcebergApiTable()
        • either by speeding up Iceberg table loading itself
        • or make the Iceberg API table serializable, so we can fetch it from CatalogD
      2. Pre-warm the cache before issuing loadIcebergApiTable()
        • so the CatalogdMetaProvider.load*() operations can be served from cache

      1 needs contributions to the Iceberg library
      2 can be done relatively easily. We just need to pre-invoke loadTableColumnStatistics() and 
      FeCatalogUtils.loadAllPartitions() (which invokes loadPartitionList() and loadPartitionsByRefs()) before loadIcebergApiTable(). So when they are needed later they can be served from cache.

      Attachments

        Activity

          People

            boroknagyz Zoltán Borók-Nagy
            boroknagyz Zoltán Borók-Nagy
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: