fixing grave bug with replication: replicator was being resumed after receiving *first* initial load, but we need to wait until after the *last* initial load

This commit is contained in:
Axel Uhl committed 2014-12-12 07:41:20 +01:00
1 parent 484f1b3514
commit 7181b2ecf9
2 files changed
+5 -4

No files matched your search

@@ -513,11 +513,12 @@ public class ReplicationServiceImpl implements ReplicationService {
try {
final GZIPInputStream gzipInputStream = new GZIPInputStream(rabbitInputStreamProvider.getInputStream());
for (Replicable<?, ?> replicable : getReplicables()) {
logger.info("Starting to receive initial load");
logger.info("Starting to receive initial load for "+replicable.getId());
replicable.initiallyFillFrom(gzipInputStream);
logger.info("Done receiving initial load");
replicator.setSuspended(false); // apply queued operations
logger.info("Done receiving initial load for "+replicable.getId());
}
logger.info("Resuming replicator to apply queues");
replicator.setSuspended(false); // apply queued operations
} finally {
// delete initial load queue
DeleteOk deleteOk = consumer.getChannel().queueDelete(queueName);