1
0
Fork 0

Coordinator will not always wait for system collection replication

This commit is contained in:
Andreas Streichardt 2016-11-22 15:07:00 +01:00
parent 63a173f002
commit c1db7228c7
1 changed files with 13 additions and 6 deletions

View File

@ -50,12 +50,19 @@
}
if (internal.threadNumber === 0) {
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 synchronous replication of system collections...');
console.info('Waiting for initial 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);
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) {