Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: state sent to be saved twice #11488

Merged
merged 3 commits into from
Feb 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -910,10 +910,12 @@ private void loadReconnectState(final SignedState signedState) {
// this guarantees that the platform status will be RECONNECT_COMPLETE before the state is saved
platformStatusManager.submitStatusAction(new ReconnectCompleteAction(signedState.getRound()));
latestImmutableState.setState(signedState.reserve("set latest immutable to reconnect state"));
stateManagementComponent.stateToLoad(signedState, SourceOfSignedState.RECONNECT);
savedStateController.reconnectStateReceived(
signedState.reserve("savedStateController.reconnectStateReceived"));
platformWiring.getSaveStateToDiskInput().put(signedState.reserve("save reconnect state to disk"));
// this will send the state to the signature collector which will send it to be written to disk.
// in the future, we might not send it to the collector because it already has all the signatures
// if this is the case, we must make sure to send it to the writer directly
stateManagementComponent.stateToLoad(signedState, SourceOfSignedState.RECONNECT);

loadStateIntoConsensus(signedState);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

import static com.swirlds.common.io.utility.FileUtils.deleteDirectoryAndLog;
import static com.swirlds.logging.legacy.LogMarker.EXCEPTION;
import static com.swirlds.logging.legacy.LogMarker.STATE_TO_DISK;
import static com.swirlds.platform.state.signed.StateToDiskReason.UNKNOWN;

import com.swirlds.base.time.Time;
Expand Down Expand Up @@ -126,7 +125,7 @@ public SignedStateFileManager(
final SignedState signedState = reservedSignedState.get();
if (signedState.hasStateBeenSavedToDisk()) {
logger.info(
STATE_TO_DISK.getMarker(),
EXCEPTION.getMarker(),
"Not saving signed state for round {} to disk because it has already been saved.",
signedState.getRound());
return null;
Expand Down