Uploaded image for project: 'Apache Ozone'
  1. Apache Ozone
  2. HDDS-8324

Remove chunk cache entry only for the lower index value used for apply transaction

Log workAgile BoardRank to TopRank to BottomAttach filesAttach ScreenshotBulk Copy AttachmentsBulk Move AttachmentsVotersWatch issueWatchersCreate sub-taskConvert to sub-taskLinkCloneLabelsUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    Description

      ContainerStateMachine in DN have stateMachineDataCache, which cache data wrt to logIndex of ratis, this is used by leader to send data to other follower.

      Issue: the cache gets cleared with incorrect logic, where all higher index is cleared, when apply transaction is called with lower index.

       

       (division.getInfo().isLeader()) {
        long minIndex = Arrays.stream(division.getInfo()
            .getFollowerNextIndices()).min().getAsLong();
        LOG.debug("Removing data corresponding to log index {} min index {} "
                + "from cache", index, minIndex);
        stateMachineDataCache.removeIf(k -> k >= (Math.min(minIndex, index)));
      } 

       

       

      Impact: 

      • with this clearing, when leader send data, it will cause disk read adding pressure over disk IO.

      As solution, the check should be k <= (Math.min(minIndex, index)) where all previous index should be cleared as follower sync is done for that.

       

      Impact with this change:

      • cache is controlled using LeaderNumPendingRequests (write.element-limit) default 1024 and pendingRequestsBytesLimit (dfs.container.ratis.leader.pending.bytes.limit) default 1GB. So further cache will block till all follower gets sync. This will be correct controlling write load over DN till all cache in sync with majority of follower.

      Attachments

        Issue Links

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            sumitagrawl Sumit Agrawal Assign to me
            sumitagrawl Sumit Agrawal
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment