Uploaded image for project: 'Infinispan'
  1. Infinispan
  2. ISPN-2356

xsite replication: only the first site replication eror is reported

This issue belongs to an archived project. You can view it, but you can't modify it. Learn more

XMLWordPrintable

      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:

       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);
               }
            }
         }
      
      

      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.

              rhn-engineering-bban Bela Ban
              rhn-engineering-bban Bela Ban
              Archiver:
              rhn-support-adongare Amol Dongare

                Created:
                Updated:
                Resolved:
                Archived: