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

Create DDL property for metadata update frequency

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 4.7.0
    • None

    Description

      On the client-side, Phoenix pings the server when a query is compiled to confirm that the client has the most up-to-date metadata for the table being queried. For some tables that are known to not change, this RPC is wasteful.

      We can allow a property such as UPDATE_CACHE_FREQUENCY to be specified a time to wait before checking with the server to see if the metadata has changed. This could be specified in the CREATE TABLE call and stored in the SYSTEM.CATALOG table header row. By default the value could be 0 which would keep the current behavior. Tables that never change could use Long.MAX_VALUE. Potentially we could allow 'ALWAYS' and 'NEVER' values for convenience.

      Proposed implementation:

      • add public long getAge() method to PTableRef.
      • when setting lastAccessTime, also store System.currentMillis() to new setAccessTime private member variable
      • the getAge() would return System.currentMillis() - setAccessTime
      • code in MetaDataClient would prevent call to server if age < UPDATE_CACHE_FREQUENCY

      Attachments

        1. preferMetaCache.patch
          13 kB
          William Yang
        2. PHOENIX-2520.patch
          97 kB
          James R. Taylor
        3. PHOENIX-2520_wip.patch
          90 kB
          James R. Taylor
        4. PHOENIX-2520_v2.patch
          97 kB
          James R. Taylor

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: