Pass only Change.Id for async background indexing
The background worker thread creates its own database connection to read the record. The change could have been modified between the time it is enqueued, and the time the indexing is processed. Always read from the database in the background thread to ensure the index gets the most recent possible data. This may fix some index state errors on gerrit-review (and friends). Change-Id: Ifab8d0ba7c9dcac54b7e168b86e9a82a3c681ea5
This commit is contained in:
@@ -228,7 +228,8 @@ public class PostReviewers implements RestModifyView<ChangeResource, AddReviewer
|
||||
db.rollback();
|
||||
}
|
||||
|
||||
CheckedFuture<?, IOException> indexFuture = indexer.indexAsync(rsrc.getChange());
|
||||
CheckedFuture<?, IOException> indexFuture =
|
||||
indexer.indexAsync(rsrc.getChange().getId());
|
||||
result.reviewers = Lists.newArrayListWithCapacity(added.size());
|
||||
for (PatchSetApproval psa : added) {
|
||||
result.reviewers.add(json.format(
|
||||
|
Reference in New Issue
Block a user