mirror of https://gitee.com/bigwinds/arangodb
Coordinator will not always wait for system collection replication
This commit is contained in:
parent
63a173f002
commit
c1db7228c7
|
@ -50,12 +50,19 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
if (internal.threadNumber === 0) {
|
if (internal.threadNumber === 0) {
|
||||||
// Wait for synchronous replication of system colls to settle:
|
var systemCollectionsCreated = global.ArangoAgency.get('SystemCollectionsCreated');
|
||||||
console.info('Waiting for synchronous replication of system collections...');
|
if (!(systemCollectionsCreated && systemCollectionsCreated.arango && systemCollectionsCreated.arango.SystemCollectionsCreated)) {
|
||||||
var db = internal.db;
|
// Wait for synchronous replication of system colls to settle:
|
||||||
var colls = db._collections();
|
console.info('Waiting for initial replication of system collections...');
|
||||||
colls = colls.filter(c => c.name()[0] === '_');
|
var db = internal.db;
|
||||||
require('@arangodb/cluster').waitForSyncRepl('_system', colls);
|
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) {
|
if (internal.threadNumber === 0) {
|
||||||
|
|
Loading…
Reference in New Issue