SOLR-13855: DistributedZkUpdateProcessor needs to propagate URP.finish()

Important since Run URP finish() propagates to updateLog to fsync()!
Closes #969
This commit is contained in:
David Smiley 2019-10-23 12:11:52 -04:00
parent c1174dc0d6
commit 3ae8204248
3 changed files with 14 additions and 14 deletions

View File

@ -348,6 +348,10 @@ Bug Fixes
* SOLR-13677: All Metrics Gauges should be unregistered by components that registered them. (noble, ab)
* SOLR-13855: DistributedZkUpdateProcessor should have been propagating URP.finish() lifecycle like it used to before
8.1 (a regression). Impacts integrity since Run URP's finish() propagates this to the updateLog to fsync.
(David Smiley)
Other Changes
----------------------

View File

@ -1089,15 +1089,17 @@ public class DistributedUpdateProcessor extends UpdateRequestProcessor {
}
@Override
public void finish() throws IOException {
assertNotFinished();
public final void finish() throws IOException {
assert ! finished : "lifecycle sanity check";
finished = true;
doDistribFinish();
super.finish();
}
protected void assertNotFinished() {
assert ! finished : "lifecycle sanity check";
finished = true;
protected void doDistribFinish() throws IOException {
// no-op for derived classes to implement
}
/**

View File

@ -1045,17 +1045,10 @@ public class DistributedZkUpdateProcessor extends DistributedUpdateProcessor {
super.processRollback(cmd);
}
@Override
public void finish() throws IOException {
// TODO: optionally fail if n replicas are not reached...
protected void doDistribFinish() {
clusterState = zkController.getClusterState();
assertNotFinished();
doFinish();
}
// TODO: optionally fail if n replicas are not reached...
private void doFinish() {
boolean shouldUpdateTerms = isLeader && isIndexChanged;
if (shouldUpdateTerms) {
ZkShardTerms zkShardTerms = zkController.getShardTerms(cloudDesc.getCollectionName(), cloudDesc.getShardId());
@ -1195,6 +1188,7 @@ public class DistributedZkUpdateProcessor extends DistributedUpdateProcessor {
if (0 < errorsForClient.size()) {
throw new DistributedUpdatesAsyncException(errorsForClient);
}
}
/**