1
0
Fork 0

Remove code which puts system services to _app. (#10378)

* Remove code which puts system services to _app.

This seems unnecessary and never worked in the cluster.

* CHANGELOG.
This commit is contained in:
Max Neunhöffer 2019-11-11 18:11:26 +01:00 committed by KVS85
parent 13df0d23de
commit 4ebe84f512
2 changed files with 3 additions and 38 deletions

View File

@ -1,6 +1,9 @@
v3.5.3 (XXXX-XX-XX)
-------------------
* Stop putting system services in _apps on single server, this has never
worked on cluster and was not needed.
* Fixed issue #10371: K_SHORTEST_PATHS LIMIT 1 can not return the shortest path.
Now the shortest path is returned as the first one in such queries.

View File

@ -284,50 +284,12 @@ function cleanupOrphanedServices (knownServicePaths, knownBundlePaths) {
}
function startup () {
if (isFoxxmaster()) {
const db = require('internal').db;
const dbName = db._name();
try {
db._useDatabase('_system');
const databases = db._databases();
for (const name of databases) {
try {
db._useDatabase(name);
upsertSystemServices();
} catch (e) {
console.warnStack(e);
}
}
} finally {
db._useDatabase(dbName);
}
}
if (global.ArangoServerState.role() === 'SINGLE') {
commitLocalState(true);
}
selfHealAll();
}
function upsertSystemServices () {
const serviceDefinitions = new Map();
for (const mount of SYSTEM_SERVICE_MOUNTS) {
try {
const serviceDefinition = utils.getServiceDefinition(mount) || {mount};
const service = FoxxService.create(serviceDefinition);
serviceDefinitions.set(mount, service.toJSON());
} catch (e) {
console.errorStack(e);
}
}
db._query(aql`
FOR item IN ${Array.from(serviceDefinitions)}
UPSERT {mount: item[0]}
INSERT item[1]
REPLACE item[1]
IN ${utils.getStorage()}
`);
}
function commitLocalState (replace) {
let modified = false;
const rootPath = FoxxService.rootPath();