]
Bela Ban commented on ISPN-2356:
--------------------------------
Thank you, too ! Next time, I promise to learn Git completely before I submit a pull
request ! :-)
xsite replication: only the first site replication eror is reported
-------------------------------------------------------------------
Key: ISPN-2356
URL:
https://issues.jboss.org/browse/ISPN-2356
Project: Infinispan
Issue Type: Bug
Components: Cross-Site Replication
Affects Versions: 5.2.0.Alpha4
Reporter: Bela Ban
Assignee: Bela Ban
Priority: Minor
Fix For: 5.2.0.Beta1
When we have a couple of backup sites (e.g. NYC and SFO) and none of them are running, a
sync replication with backupFailurePolicy=FAIL with throw an exception on the first
failure, e.g. SFO. However it will not report the failure for NYC.
Not sure if this is crucial, but I suspect somewhere someone counts the failures per
site, and in this case NYC would not show any failures until SFO is taken offline.
The code is in BackupSenderImpl:
{code}
public void processResponses(BackupResponse backupResponse, VisitableCommand command,
Transaction transaction) throws Throwable {
backupResponse.waitForBackupToFinish();
SitesConfiguration sitesConfiguration = config.sites();
Map<String, Throwable> failures = backupResponse.getFailedBackups();
for (Map.Entry<String, Throwable> failure : failures.entrySet()) {
BackupFailurePolicy policy =
sitesConfiguration.getFailurePolicy(failure.getKey());
if (policy == BackupFailurePolicy.CUSTOM) {
CustomFailurePolicy customFailurePolicy =
siteFailurePolicy.get(failure.getKey());
command.acceptVisitor(null, new CustomBackupPolicyInvoker(failure.getKey(),
customFailurePolicy, transaction));
}
if (policy == BackupFailurePolicy.WARN) {
log.warnXsiteBackupFailed(cacheName, failure.getKey(), failure.getValue());
} else if (policy == BackupFailurePolicy.FAIL) {
throw new BackupFailureException(failure.getValue(),failure.getKey(),
cacheName);
}
}
}
{code}
Iterating through the failure map, we throw a BackupFailureException on the *first*
failure. I suggest to either collect all exceptions (also when invoking the custom failure
policy !) and throw them as a new exception (listing all of them) or to simply log the
situation as an error.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: