Uploaded image for project: 'Apache AsterixDB'
  1. Apache AsterixDB
  2. ASTERIXDB-2329

Drop Dataverse Throws Resource Not Exists Exception

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: MTD - Metadata
    • Labels:
      None

      Description

      Previously I constantly encounter ResourceNotExistException when dropping dataverse. After some digging, I found the problem is caused as follows:

      1. Start a fresh AsterixDB, and create dataverse/dataset.

      drop dataverse test if exists;
      create dataverse test;
      use test;
      create type testType as{id:int};
      create dataset testDS(testType) primary key id;
      create primary index primaryIdx on testDS;
      

      2. Insert a record.

      use test;
      insert into testDS{"id":1};
      

      3. Shutdown AsterixDB.
      4. Re-start AsterixDB.
      5. Drop and recreate the same dataverse.

      drop dataverse test if exists;
      create dataverse test;
      use test;
      create type testType as{id:int};
      create dataset testDS(testType) primary key id;
      create primary index primaryIdx on testDS;
      

      Now we can get an exception:

      org.apache.hyracks.api.exceptions.HyracksDataException: HYR0055: Resource does not exist for storage/partition_1/test/testDS/0/testDS
      	at org.apache.hyracks.api.exceptions.HyracksDataException.create(HyracksDataException.java:55) ~[classes/:?]
      	at org.apache.asterix.transaction.management.resource.PersistentLocalResourceRepository.delete(PersistentLocalResourceRepository.java:210) ~[classes/:?]
      	at org.apache.hyracks.storage.am.common.build.IndexBuilder.build(IndexBuilder.java:78) ~[classes/:?]
      	at org.apache.hyracks.storage.am.common.dataflow.IndexCreateOperatorNodePushable.initialize(IndexCreateOperatorNodePushable.java:52) ~[classes/:?]
      	at org.apache.hyracks.api.rewriter.runtime.SuperActivityOperatorNodePushable.lambda$runInParallel$0(SuperActivityOperatorNodePushable.java:204) ~[classes/:?]
      	at java.util.concurrent.FutureTask.run(FutureTask.java:266) ~[?:1.8.0_121]
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [?:1.8.0_121]
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [?:1.8.0_121]
      	at java.lang.Thread.run(Thread.java:745) [?:1.8.0_121]
      

      The root cause seems to be that drop dataverse in step 5 is not executed properly. It suppose to drop all datasets, all indexes associated with the dataverse. However, line 1253 of QueryTranslator returns empty index list (MetadataManager.getDatasetIndexes returns at line 292 because the dataset does not exist in cache), which causes indexes are not dropped properly.

        Attachments

          Activity

            People

            • Assignee:
              mhubail Murtadha Makki Al Hubail
              Reporter:
              luochen01 Chen Luo
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: