diff options
author | Valerij Fredriksen <valerijf@yahooinc.com> | 2023-04-21 14:43:08 +0200 |
---|---|---|
committer | Valerij Fredriksen <valerijf@yahooinc.com> | 2023-04-21 14:43:08 +0200 |
commit | 522c7b5dedfc706fb5d4260431f9a8daa722fb31 (patch) | |
tree | 3b054f4977b96d9c800b7c806aa73a1ee7cc3183 /controller-server | |
parent | e3286f1470f20af980a982b1331f90e3d841015a (diff) |
Code review fixes
Diffstat (limited to 'controller-server')
2 files changed, 4 insertions, 5 deletions
diff --git a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/restapi/application/ApplicationApiHandler.java b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/restapi/application/ApplicationApiHandler.java index 29fb095d8b5..d5029d2d8a5 100644 --- a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/restapi/application/ApplicationApiHandler.java +++ b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/restapi/application/ApplicationApiHandler.java @@ -2050,10 +2050,9 @@ public class ApplicationApiHandler extends AuditLoggingRequestHandler { else numInitial++; } - if ((numInitial > 0 && numNoReport > 0) || - (numReadied > 0 && (numNoReport > 0 || numInitial > 0 || numDropped > 0)) || - (numStarted > 0 && (numInitial > 0 || numDropped > 0))) - return ErrorResponse.conflict("Inconsistent state, try restarting drop documents again"); + if (numInitial + numDropped > 0 && numNoReport + numReadied + numStarted > 0) + return ErrorResponse.conflict("Last dropping of documents may have failed to clear all documents due " + + "to concurrent topology changes, consider retrying"); Slime slime = new Slime(); Cursor root = slime.setObject(); diff --git a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/ApplicationApiTest.java b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/ApplicationApiTest.java index e15a54e9348..5b75d8cb914 100644 --- a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/ApplicationApiTest.java +++ b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/ApplicationApiTest.java @@ -541,7 +541,7 @@ public class ApplicationApiTest extends ControllerContainerTest { nodeRepository.putNodes(zone, List.of(nodeBuilder.apply(1, "{}"), nodeBuilder.apply(2, null))); tester.assertResponse(request("/application/v4/tenant/tenant2/application/application1/instance/default/environment/dev/region/us-east-1/drop-documents", GET).userIdentity(USER_ID), - "{\"error-code\":\"CONFLICT\",\"message\":\"Inconsistent state, try restarting drop documents again\"}", 409); + "{\"error-code\":\"CONFLICT\",\"message\":\"Last dropping of documents may have failed to clear all documents due to concurrent topology changes, consider retrying\"}", 409); nodeRepository.putNodes(zone, List.of(nodeBuilder.apply(1, "{}"), nodeBuilder.apply(2, "{\"droppedAt\":1}"))); tester.assertResponse(request("/application/v4/tenant/tenant2/application/application1/instance/default/environment/dev/region/us-east-1/drop-documents", GET).userIdentity(USER_ID), |