52
52
import java .util .Set ;
53
53
54
54
import static org .opensearch .cluster .coordination .Coordinator .ZEN1_BWC_TERM ;
55
+ import static org .opensearch .node .remotestore .RemoteStoreNodeAttribute .isRemoteRoutingTableEnabled ;
55
56
import static org .opensearch .node .remotestore .RemoteStoreNodeAttribute .isRemoteStoreClusterStateEnabled ;
56
57
57
58
/**
@@ -78,7 +79,7 @@ public class CoordinationState {
78
79
private long lastPublishedVersion ;
79
80
private VotingConfiguration lastPublishedConfiguration ;
80
81
private VoteCollection publishVotes ;
81
- private final boolean isRemoteStateEnabled ;
82
+ private final boolean isRemotePublicationEnabled ;
82
83
83
84
public CoordinationState (
84
85
DiscoveryNode localNode ,
@@ -101,11 +102,11 @@ public CoordinationState(
101
102
.getLastAcceptedState ()
102
103
.getLastAcceptedConfiguration ();
103
104
this .publishVotes = new VoteCollection ();
104
- this .isRemoteStateEnabled = isRemoteStoreClusterStateEnabled (settings );
105
+ this .isRemotePublicationEnabled = isRemoteStoreClusterStateEnabled ( settings ) && isRemoteRoutingTableEnabled (settings );
105
106
}
106
107
107
- public boolean isRemoteStateEnabled () {
108
- return isRemoteStateEnabled ;
108
+ public boolean isRemotePublicationEnabled () {
109
+ return isRemotePublicationEnabled ;
109
110
}
110
111
111
112
public long getCurrentTerm () {
@@ -579,7 +580,7 @@ public void handlePrePublish(ClusterState clusterState) {
579
580
// This is to ensure the remote store is the single source of truth for current state. Even if the current node
580
581
// goes down after sending the cluster state to other nodes, we should be able to read the remote state and
581
582
// recover the cluster.
582
- if (isRemoteStateEnabled ) {
583
+ if (isRemotePublicationEnabled ) {
583
584
assert persistedStateRegistry .getPersistedState (PersistedStateType .REMOTE ) != null : "Remote state has not been initialized" ;
584
585
persistedStateRegistry .getPersistedState (PersistedStateType .REMOTE ).setLastAcceptedState (clusterState );
585
586
}
@@ -590,7 +591,7 @@ public void handlePrePublish(ClusterState clusterState) {
590
591
*/
591
592
public void handlePreCommit () {
592
593
// Publishing the committed state to remote store before sending apply commit to other nodes.
593
- if (isRemoteStateEnabled ) {
594
+ if (isRemotePublicationEnabled ) {
594
595
assert persistedStateRegistry .getPersistedState (PersistedStateType .REMOTE ) != null : "Remote state has not been initialized" ;
595
596
persistedStateRegistry .getPersistedState (PersistedStateType .REMOTE ).markLastAcceptedStateAsCommitted ();
596
597
}
0 commit comments