From c1db7228c7ced2bbf200dbcebd13cedd82259c92 Mon Sep 17 00:00:00 2001 From: Andreas Streichardt Date: Tue, 22 Nov 2016 15:07:00 +0100 Subject: [PATCH] Coordinator will not always wait for system collection replication --- js/server/bootstrap/coordinator.js | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/js/server/bootstrap/coordinator.js b/js/server/bootstrap/coordinator.js index 57d8f39000..5ace44dd9f 100644 --- a/js/server/bootstrap/coordinator.js +++ b/js/server/bootstrap/coordinator.js @@ -50,12 +50,19 @@ } if (internal.threadNumber === 0) { - // Wait for synchronous replication of system colls to settle: - console.info('Waiting for synchronous replication of system collections...'); - var db = internal.db; - var colls = db._collections(); - colls = colls.filter(c => c.name()[0] === '_'); - require('@arangodb/cluster').waitForSyncRepl('_system', colls); + var systemCollectionsCreated = global.ArangoAgency.get('SystemCollectionsCreated'); + if (!(systemCollectionsCreated && systemCollectionsCreated.arango && systemCollectionsCreated.arango.SystemCollectionsCreated)) { + // Wait for synchronous replication of system colls to settle: + console.info('Waiting for initial replication of system collections...'); + var db = internal.db; + var colls = db._collections(); + colls = colls.filter(c => c.name()[0] === '_'); + if (!require('@arangodb/cluster').waitForSyncRepl('_system', colls)) { + console.error('System collections not properly set up. Starting anyway now...'); + } else { + global.ArangoAgency.set('SystemCollectionsCreated', true); + } + } } if (internal.threadNumber === 0) {