mirror of https://gitee.com/bigwinds/arangodb
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:
parent
13df0d23de
commit
4ebe84f512
|
@ -1,6 +1,9 @@
|
||||||
v3.5.3 (XXXX-XX-XX)
|
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.
|
* 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.
|
Now the shortest path is returned as the first one in such queries.
|
||||||
|
|
||||||
|
|
|
@ -284,50 +284,12 @@ function cleanupOrphanedServices (knownServicePaths, knownBundlePaths) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function startup () {
|
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') {
|
if (global.ArangoServerState.role() === 'SINGLE') {
|
||||||
commitLocalState(true);
|
commitLocalState(true);
|
||||||
}
|
}
|
||||||
selfHealAll();
|
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) {
|
function commitLocalState (replace) {
|
||||||
let modified = false;
|
let modified = false;
|
||||||
const rootPath = FoxxService.rootPath();
|
const rootPath = FoxxService.rootPath();
|
||||||
|
|
Loading…
Reference in New Issue