From 2e417a1576eddefe5e926e877253efab996f7ba7 Mon Sep 17 00:00:00 2001 From: Michael Hackstein Date: Wed, 26 Apr 2017 10:50:38 +0200 Subject: [PATCH 1/3] db._explain should now be backwards-compatible if we access a 3.1 instance with a 3.2 arangosh --- js/common/modules/@arangodb/aql/explainer.js | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/js/common/modules/@arangodb/aql/explainer.js b/js/common/modules/@arangodb/aql/explainer.js index cd5333ee77..adfdd2850e 100644 --- a/js/common/modules/@arangodb/aql/explainer.js +++ b/js/common/modules/@arangodb/aql/explainer.js @@ -348,7 +348,13 @@ function printTraversalDetails (traversals) { } } if (node.hasOwnProperty('options')) { - var opts = optify(node.options); + let opts = optify(node.options); + if (opts.length > maxOptionsLen) { + maxOptionsLen = opts.length; + } + } else if (node.hasOwnProperty("traversalFlags")) { + // Backwards compatibility for < 3.2 + let opts = optify(node.traversalFlags); if (opts.length > maxOptionsLen) { maxOptionsLen = opts.length; } @@ -386,6 +392,8 @@ function printTraversalDetails (traversals) { if (traversals[i].hasOwnProperty('options')) { line += optify(traversals[i].options, true) + pad(1 + maxOptionsLen - optify(traversals[i].options, false).length) + ' '; + } else if (traversals[i].hasOwnProperty('traversalFlags')) { + line += optify(traversals[i].traversalFlags, true) + pad(1 + maxOptionsLen - optify(traversals[i].traversalFlags, false).length) + ' '; } else { line += pad(1 + maxOptionsLen) + ' '; } @@ -856,7 +864,13 @@ function processQuery (query, explain) { return keyword('FOR') + ' ' + variableName(node.outVariable) + ' ' + keyword('IN') + ' ' + collection(node.collection) + ' ' + annotation('/* ' + (node.reverse ? 'reverse ' : '') + node.index.type + ' index scan */'); case 'TraversalNode': - node.minMaxDepth = node.options.minDepth + '..' + node.options.maxDepth; + if (node.hasOwnProperty("options")) { + node.minMaxDepth = node.options.minDepth + '..' + node.options.maxDepth; + } else if (node.hasOwnProperty("traversalFlags")) { + node.minMaxDepth = node.traversalFlags.minDepth + '..' + node.traversalFlags.maxDepth; + } else { + node.minMaxDepth = '1..1'; + } node.minMaxDepthLen = node.minMaxDepth.length; rc = keyword('FOR '); From 5beae6081b343ee8be5076dfe7caf562606f9515 Mon Sep 17 00:00:00 2001 From: Michael Hackstein Date: Wed, 26 Apr 2017 11:04:01 +0200 Subject: [PATCH 2/3] Removed double include due to hidden merge conflict. --- arangod/Aql/ShortestPathBlock.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/arangod/Aql/ShortestPathBlock.cpp b/arangod/Aql/ShortestPathBlock.cpp index f8f57a6350..d866c2f061 100644 --- a/arangod/Aql/ShortestPathBlock.cpp +++ b/arangod/Aql/ShortestPathBlock.cpp @@ -31,8 +31,6 @@ #include "Graph/ConstantWeightShortestPathFinder.h" #include "Graph/ShortestPathFinder.h" #include "Graph/ShortestPathResult.h" -#include "Graph/AttributeWeightShortestPathFinder.h" -#include "Graph/ConstantWeightShortestPathFinder.h" #include "Transaction/Methods.h" #include "Utils/OperationCursor.h" #include "VocBase/LogicalCollection.h" From 3c23a83f4e8f57d8427f25581107b1bdc6bed777 Mon Sep 17 00:00:00 2001 From: Wilfried Goesgens Date: Wed, 26 Apr 2017 11:06:30 +0200 Subject: [PATCH 3/3] give the system some time to write the core dumps --- js/client/modules/@arangodb/crash-utils.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/js/client/modules/@arangodb/crash-utils.js b/js/client/modules/@arangodb/crash-utils.js index 09cd099048..4fd4bd3166 100644 --- a/js/client/modules/@arangodb/crash-utils.js +++ b/js/client/modules/@arangodb/crash-utils.js @@ -29,6 +29,7 @@ const fs = require('fs'); const yaml = require('js-yaml'); const executeExternalAndWait = require('internal').executeExternalAndWait; const statusExternal = require('internal').statusExternal; +const sleep = require('internal').sleep; let GDB_OUTPUT = ''; @@ -77,6 +78,7 @@ function analyzeCoreDump (instanceInfo, options, storeArangodPath, pid) { const args = ['-c', command]; print(JSON.stringify(args)); + sleep(5); executeExternalAndWait('/bin/bash', args); GDB_OUTPUT = fs.read(gdbOutputFile); print(GDB_OUTPUT); @@ -118,6 +120,7 @@ function analyzeCoreDumpMac (instanceInfo, options, storeArangodPath, pid) { const args = ['-c', command]; print(JSON.stringify(args)); + sleep(5); executeExternalAndWait('/bin/bash', args); GDB_OUTPUT = fs.read(lldbOutputFile); print(GDB_OUTPUT); @@ -152,6 +155,7 @@ function analyzeCoreDumpWindows (instanceInfo) { dbgCmds.join('; ') ]; + sleep(5); print('running cdb ' + JSON.stringify(args)); executeExternalAndWait('cdb', args);