You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by "Jackson Yao (Jira)" <ji...@apache.org> on 2021/08/11 06:23:00 UTC
[jira] [Updated] (HDDS-5529) For any exception from addToBuffer or
removeFromBuffer we should throw exception
[ https://issues.apache.org/jira/browse/HDDS-5529?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Jackson Yao updated HDDS-5529:
------------------------------
Summary: For any exception from addToBuffer or removeFromBuffer we should throw exception (was: For any exception from addToBuffer we should throw exception)
> For any exception from addToBuffer or removeFromBuffer we should throw exception
> --------------------------------------------------------------------------------
>
> Key: HDDS-5529
> URL: https://issues.apache.org/jira/browse/HDDS-5529
> Project: Apache Ozone
> Issue Type: Sub-task
> Reporter: Jackson Yao
> Assignee: Jackson Yao
> Priority: Major
>
> 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.
> {code:java}
> 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;
> }
> {code}
> so , we should make sure all the exception will be throw out at `@Replicate` functions
--
This message was sent by Atlassian Jira
(v8.3.4#803005)
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org