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

Avoid repeatedly loading IndexMetaData For IndexRegionObserver

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 4.15.0, 5.1.0
    • 4.15.0, 5.1.0
    • None
    • None

    Description

      Loading IndexMetaData is a somewhat expensive operation because it may deserialize from scan attribute. In following IndexRegionObserver.preBatchMutateWithExceptions method, IndexMetaData is loaded already for line 613, but in IndexRegionObserver.prepareIndexMutations method which is invoked by line 639, IndexMetaData is loaded again, which is unnecessary.

      610 public void preBatchMutateWithExceptions(ObserverContext<RegionCoprocessorEnvironment> c,
      611                    MiniBatchOperationInProgress<Mutation> miniBatchOp) throws Throwable {
      612         ignoreAtomicOperations(miniBatchOp);
      613         BatchMutateContext context = new BatchMutateContext(this.builder.getIndexMetaData(miniBatchOp).getClientVersion());
      614        setBatchMutateContext(c, context);
      615         Mutation firstMutation = miniBatchOp.getOperation(0);
                    ....
      639        prepareIndexMutations(c, miniBatchOp, context, mutations, now);
      640        metricSource.updateIndexPrepareTime(EnvironmentEdgeManager.currentTimeMillis() - start);
      

      Attachments

        Activity

          People

            comnetwork chenglei
            chenglei Chenglei
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: