Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,9 @@
import org.elasticsearch.repositories.IndexId;
import org.elasticsearch.repositories.Repository;
import org.elasticsearch.threadpool.ThreadPool;
import org.elasticsearch.transport.EmptyTransportResponseHandler;
import org.elasticsearch.transport.TransportException;
import org.elasticsearch.transport.TransportRequestDeduplicator;
import org.elasticsearch.transport.TransportResponse;
import org.elasticsearch.transport.TransportResponseHandler;
import org.elasticsearch.transport.TransportService;

import java.io.IOException;
Expand Down Expand Up @@ -508,16 +507,28 @@ public void onFailure(Exception e) {
}
},
(req, reqListener) -> transportService.sendRequest(transportService.getLocalNode(), UPDATE_SNAPSHOT_STATUS_ACTION_NAME, req,
new EmptyTransportResponseHandler(ThreadPool.Names.SAME) {
new TransportResponseHandler<UpdateIndexShardSnapshotStatusResponse>() {
@Override
public void handleResponse(TransportResponse.Empty response) {
public UpdateIndexShardSnapshotStatusResponse read(StreamInput in) throws IOException {
final UpdateIndexShardSnapshotStatusResponse response = new UpdateIndexShardSnapshotStatusResponse();
response.readFrom(in);
return response;
}

@Override
public void handleResponse(UpdateIndexShardSnapshotStatusResponse response) {
reqListener.onResponse(null);
}

@Override
public void handleException(TransportException exp) {
reqListener.onFailure(exp);
}

@Override
public String executor() {
return ThreadPool.Names.SAME;
}
})
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -988,7 +988,6 @@ public void testMasterShutdownDuringFailedSnapshot() throws Exception {
* can be restored when the node the shrunken index was created on is no longer part of
* the cluster.
*/
@AwaitsFix(bugUrl="https://github.com/elastic/elasticsearch/issues/38256")
public void testRestoreShrinkIndex() throws Exception {
logger.info("--> starting a master node and a data node");
internalCluster().startMasterOnlyNode();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3637,7 +3637,6 @@ public void testParallelRestoreOperationsFromSingleSnapshot() throws Exception {
}

@TestLogging("org.elasticsearch.snapshots:TRACE")
@AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/38226")
public void testAbortedSnapshotDuringInitDoesNotStart() throws Exception {
final Client client = client();

Expand Down Expand Up @@ -3684,8 +3683,13 @@ public void testAbortedSnapshotDuringInitDoesNotStart() throws Exception {

// The deletion must set the snapshot in the ABORTED state
assertBusy(() -> {
SnapshotsStatusResponse status = client.admin().cluster().prepareSnapshotStatus("repository").setSnapshots("snap").get();
assertThat(status.getSnapshots().iterator().next().getState(), equalTo(State.ABORTED));
try {
SnapshotsStatusResponse status =
client.admin().cluster().prepareSnapshotStatus("repository").setSnapshots("snap").get();
assertThat(status.getSnapshots().iterator().next().getState(), equalTo(State.ABORTED));
} catch (Exception e) {
throw new AssertionError(e);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe add a comment to say that here we rethrow in AssertionError to force assertBusy to retry.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, I added it :)

Copy link
Contributor

@DaveCTurner DaveCTurner Feb 3, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@original-brownbear this assertBusy failed on a local ./gradlew check - here is the log from the test:
testAbortedSnapshotDuringInitDoesNotStart-failure.log.gz.

Copy link
Contributor Author

@original-brownbear original-brownbear Feb 3, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@DaveCTurner thanks! I think I have an idea where this is coming from still ... Will fix later/tomorrow :)

}
});

// Now unblock the repository
Expand Down