Uploaded image for project: 'Apache Ozone'
  1. Apache Ozone
  2. HDDS-2823 SCM HA Support
  3. HDDS-5529

For any IOexception from @Replicated method we should throw it

    XMLWordPrintableJSON

Details

    • Sub-task
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 1.3.0
    • None

    Description

      when HA is enabled , if an exception is thrown when applying transaction,  scm will be termainated , so that DBs of different scms will not diverge.

      public CompletableFuture<Message> applyTransaction(
            final TransactionContext trx) {
          final CompletableFuture<Message> applyTransactionFuture =
              new CompletableFuture<>();
          try {
            final SCMRatisRequest request = SCMRatisRequest.decode(
                Message.valueOf(trx.getStateMachineLogEntry().getLogData()));
            applyTransactionFuture.complete(process(request));
      
            // After previous term transactions are applied, still in safe mode,
            // perform refreshAndValidate to update the safemode rule state.
            if (scm.isInSafeMode() && refreshedAfterLeaderReady.get()) {
              scm.getScmSafeModeManager().refreshAndValidate();
            }
            transactionBuffer.updateLatestTrxInfo(TransactionInfo.builder()
                .setCurrentTerm(trx.getLogEntry().getTerm())
                .setTransactionIndex(trx.getLogEntry().getIndex())
                .build());
          } catch (Exception ex) {
            applyTransactionFuture.completeExceptionally(ex);
            ExitUtils.terminate(1, ex.getMessage(), ex, StateMachine.LOG);
          }
          return applyTransactionFuture;
        }
      

      so , we should make sure if HA is enabled , all the exception will be throw out at `@Replicate` functions

      Attachments

        Issue Links

          Activity

            People

              jacksonyao Jie Yao
              jacksonyao Jie Yao
              Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: