Skip to content
Draft
Show file tree
Hide file tree
Changes from all 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 @@ -364,6 +364,8 @@ private RouterErrorCode processServerError(ServerErrorCode serverErrorCode) {
return RouterErrorCode.BlobNotDeleted;
case BlobAlreadyUndeleted:
return RouterErrorCode.BlobUndeleted;
case BlobDeletedPermanently:
return RouterErrorCode.BlobDeleted;
case BlobLifeVersionConflict:
return RouterErrorCode.LifeVersionConflict;
default:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,30 @@ public void singleFailureTest() throws Exception {
}
}

/**
* Failure tests when servers return BlobDeletedPermanently because the blob has been compacted.
* The router should surface this as RouterErrorCode.BlobDeleted.
* @throws Exception
*/
@Test
public void blobDeletedPermanentlyTest() throws Exception {
HashMap<String, List<MockServer>> dcToMockServers = new HashMap<>();
serverLayout.getMockServers()
.forEach(server -> dcToMockServers.computeIfAbsent(server.getDataCenter(), k -> new ArrayList()).add(server));
String dc = new ArrayList<>(dcToMockServers.keySet()).get(0);
List<MockServer> servers = dcToMockServers.get(dc);
for (String blobId : blobIds) {
deleteBlobInAllServer(blobId);

for (MockServer server : servers.subList(0, 2)) {
server.setServerErrorForAllRequests(ServerErrorCode.BlobDeletedPermanently);
}

executeOpAndVerify(Collections.singleton(blobId), RouterErrorCode.BlobDeleted);
serverLayout.getMockServers().forEach(server -> server.resetServerErrors());
}
}

/**
* Failure tests when undelete request is rejected due to quota compliance.
* @throws Exception
Expand Down
Loading