@@ -135,22 +135,23 @@ public SnapshotShardsService(Settings settings, ClusterService clusterService, S
135
135
clusterService .addListener (this );
136
136
}
137
137
138
+ // The constructor of UpdateSnapshotStatusAction will register itself to the TransportService.
139
+ this .updateSnapshotStatusHandler = new UpdateSnapshotStatusAction (settings , UPDATE_SNAPSHOT_STATUS_ACTION_NAME ,
140
+ transportService , clusterService , threadPool , actionFilters , indexNameExpressionResolver );
141
+
138
142
if (DiscoveryNode .isMasterNode (settings )) {
139
143
// This needs to run only on nodes that can become masters
140
144
transportService .registerRequestHandler (UPDATE_SNAPSHOT_STATUS_ACTION_NAME_V6 , UpdateSnapshotStatusRequestV6 ::new , ThreadPool .Names .SAME , new UpdateSnapshotStateRequestHandlerV6 ());
141
- // The constructor of UpdateSnapshotStatusAction will register itself to the TransportService.
142
- this .updateSnapshotStatusHandler = new UpdateSnapshotStatusAction (settings , UPDATE_SNAPSHOT_STATUS_ACTION_NAME ,
143
- transportService , clusterService , threadPool , actionFilters , indexNameExpressionResolver );
144
145
}
145
146
146
147
}
147
148
148
149
@ Override
149
150
protected void doStart () {
151
+ assert this .updateSnapshotStatusHandler != null ;
152
+ assert transportService .getRequestHandler (UPDATE_SNAPSHOT_STATUS_ACTION_NAME ) != null ;
150
153
if (DiscoveryNode .isMasterNode (settings )) {
151
- assert this .updateSnapshotStatusHandler != null ;
152
154
assert transportService .getRequestHandler (UPDATE_SNAPSHOT_STATUS_ACTION_NAME_V6 ) != null ;
153
- assert transportService .getRequestHandler (UPDATE_SNAPSHOT_STATUS_ACTION_NAME ) != null ;
154
155
}
155
156
}
156
157
@@ -530,7 +531,7 @@ public void updateIndexShardSnapshotStatus(Snapshot snapshot, ShardId shardId, S
530
531
try {
531
532
if (master .getVersion ().onOrAfter (Version .V_7_0_0_alpha1 )) {
532
533
UpdateIndexShardSnapshotStatusRequest request = new UpdateIndexShardSnapshotStatusRequest (snapshot , shardId , status );
533
- transportService .sendRequest (master , UPDATE_SNAPSHOT_STATUS_ACTION_NAME , request , EmptyTransportResponseHandler .INSTANCE_SAME );
534
+ transportService .sendRequest (transportService . getLocalNode () , UPDATE_SNAPSHOT_STATUS_ACTION_NAME , request , EmptyTransportResponseHandler .INSTANCE_SAME );
534
535
} else {
535
536
UpdateSnapshotStatusRequestV6 requestV6 = new UpdateSnapshotStatusRequestV6 (snapshot , shardId , status );
536
537
transportService .sendRequest (master , UPDATE_SNAPSHOT_STATUS_ACTION_NAME_V6 , requestV6 , EmptyTransportResponseHandler .INSTANCE_SAME );
0 commit comments