From 50ceb44fc3971f57b1c839ada091b4837a1e63cf Mon Sep 17 00:00:00 2001 From: Dave Borowitz Date: Thu, 3 Oct 2013 08:54:28 -0700 Subject: [PATCH] Remove wait_for_commit from POST /changes/X/revisions/Y/review There are many REST endpoints that modify changes and need to block for index writes to occur; there is nothing special about PostReview. Change-Id: I1786999c1c172ebdf6accfaa9839201702e5f585 --- Documentation/rest-api-changes.txt | 4 ---- .../java/com/google/gerrit/server/change/PostReview.java | 6 +----- .../java/com/google/gerrit/sshd/commands/ReviewCommand.java | 1 - 3 files changed, 1 insertion(+), 10 deletions(-) diff --git a/Documentation/rest-api-changes.txt b/Documentation/rest-api-changes.txt index e2a8fbe358..66abebfbc0 100644 --- a/Documentation/rest-api-changes.txt +++ b/Documentation/rest-api-changes.txt @@ -3117,10 +3117,6 @@ If not set, the default is `ALL`. link:rest-api-accounts.html#account-id[\{account-id\}] the review should be posted on behalf of. To use this option the caller must have been granted `labelAs-NAME` permission for all keys of labels. -|`wait_for_commit`|optional| -Whether the request should wait for commit to the index to finish. -If `false` (default) the request returns after the data is sent to -the index, but searches may not immediately see the update. |============================ [[reviewer-info]] diff --git a/gerrit-server/src/main/java/com/google/gerrit/server/change/PostReview.java b/gerrit-server/src/main/java/com/google/gerrit/server/change/PostReview.java index b26e9161f1..92e53ec21d 100644 --- a/gerrit-server/src/main/java/com/google/gerrit/server/change/PostReview.java +++ b/gerrit-server/src/main/java/com/google/gerrit/server/change/PostReview.java @@ -100,8 +100,6 @@ public class PostReview implements RestModifyView { * not the caller. */ public String onBehalfOf; - - public boolean waitForCommit; } public static enum DraftHandling { @@ -206,9 +204,7 @@ public class PostReview implements RestModifyView { Output output = new Output(); output.labels = input.labels; - if (input.waitForCommit) { - indexWrite.checkedGet(); - } + indexWrite.checkedGet(); return output; } diff --git a/gerrit-sshd/src/main/java/com/google/gerrit/sshd/commands/ReviewCommand.java b/gerrit-sshd/src/main/java/com/google/gerrit/sshd/commands/ReviewCommand.java index 7af882ee15..e5eb567271 100644 --- a/gerrit-sshd/src/main/java/com/google/gerrit/sshd/commands/ReviewCommand.java +++ b/gerrit-sshd/src/main/java/com/google/gerrit/sshd/commands/ReviewCommand.java @@ -229,7 +229,6 @@ public class ReviewCommand extends SshCommand { review.labels = Maps.newTreeMap(); review.drafts = PostReview.DraftHandling.PUBLISH; review.strictLabels = false; - review.waitForCommit = true; for (ApproveOption ao : optionList) { Short v = ao.value(); if (v != null) {