Uploaded image for project: 'Apache Ozone'
  1. Apache Ozone
  2. HDDS-7759 Improve Ozone Replication Manager
  3. HDDS-7915

Force close QUASI_CLOSED replicas only when the container is CLOSED in Legacy RM

    XMLWordPrintableJSON

Details

    • Sub-task
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 1.4.0
    • SCM

    Description

      LegacyReplicationManager#closeReplicasIfPossible tries to close replicas.

        private int closeReplicasIfPossible(ContainerInfo container,
                                            List<ContainerReplica> replicas) {
          // This method should not be used on open containers.
          if (container.getState() == LifeCycleState.OPEN) {
            return 0;
          }
      
          int numCloseCmdsSent = 0;
          Iterator<ContainerReplica> iterator = replicas.iterator();
          while (iterator.hasNext()) {
            final ContainerReplica replica = iterator.next();
            final State state = replica.getState();
            if (state == State.OPEN || state == State.CLOSING) {
              sendCloseCommand(container, replica.getDatanodeDetails(), false);
              numCloseCmdsSent++;
              iterator.remove();
            } else if (state == State.QUASI_CLOSED) {
              // Send force close command if the BCSID matches
              if (container.getSequenceId() == replica.getSequenceId()) {
                sendCloseCommand(container, replica.getDatanodeDetails(), true);
                numCloseCmdsSent++;
                iterator.remove();
              }
            }
          }
      
          return numCloseCmdsSent;
        }
      

      In one case, this method is called from LegacyReplicationManager#handleUnderReplicatedUnhealthy, where the replica's state matches the container state. If the state is QUASI_CLOSED, we will end up closing the replica and eventually the container, even though the replica doesn't have all the data. This should not happen and is what this jira is meant to fix. Force closing a QUASI_CLOSED replica of a QUASI_CLOSED container is handled separately earlier in the processContainer method.

      Attachments

        Issue Links

          Activity

            People

              siddhant Siddhant Sangwan
              siddhant Siddhant Sangwan
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: