Uploaded image for project: 'Hive'
  1. Hive
  2. HIVE-20953

Remove a function from function registry when it can not be added to the metastore when creating it.

    XMLWordPrintableJSON

Details

    Description

      The testcase is intended to test REPL LOAD with retry. The test creates a partitioned table and a function in the source database and loads those to the replica. The first attempt to load a dump is intended to fail while loading one of the partitions. Based on the order in which the objects get loaded, if the function is queued after the table, it will not be available in replica after the load failure. But if it's queued before the table, it will be available in replica even after the load failure. The test assumes the later case, which may not be true always.

      Hence fix the testcase to order the objects by a fixed ordering. By setting hive.in.repl.test.files.sorted to true, the objects are ordered by the directory names. This ordering is available with minimal changes for testing, hence we use it. With this ordering a function gets loaded before a table. So changed the test to not expect the function to be available after the failed load, but be available after the retry.

      While writing that testcase, I found that even if a function fails to load, it's visible through show functions and also is available to be called just as if the failure has not happened. Digging further it was found that when creating a function we add it to the registry and also to the metastore. If the later fails, we do not clean it up from the registry and thus it remains visible after failure. Fixed the same.

      Attachments

        1. HIVE-20953.01
          3 kB
          Ashutosh Bapat
        2. HIVE-20953.02
          8 kB
          Ashutosh Bapat
        3. HIVE-20953.02
          3 kB
          László Bodor
        4. HIVE-20953.03
          8 kB
          Ashutosh Bapat
        5. HIVE-20953.03
          8 kB
          Ashutosh Bapat
        6. test_func_load_failure_retry.patch
          4 kB
          Ashutosh Bapat

        Issue Links

          Activity

            People

              ashutosh.bapat Ashutosh Bapat
              ashutosh.bapat Ashutosh Bapat
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - 24h
                  24h
                  Remaining:
                  Remaining Estimate - 24h
                  24h
                  Logged:
                  Time Spent - Not Specified
                  Not Specified