-
Notifications
You must be signed in to change notification settings - Fork 858
BTS 2183 - Fix restore with vector index when feature disabled #21885
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: devel
Are you sure you want to change the base?
Conversation
return data; | ||
} | ||
|
||
function createDumpJsonFile(path, databaseName, id) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks like an unused function.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think instead of duplicating functions from tests/js/client/shell/shell-restore-integration.js
they rather should be moved out of it to js/client/modules/\@arangodb/test-helper.js
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah I assumed eslint would report unused functions. I will move the copied stuff into test-helper.js
const isCluster = require("internal").isCluster(); | ||
const { executeExternalAndWaitWithSanitizer } = require('@arangodb/test-helper'); | ||
const { versionHas } = require("@arangodb/test-helper"); | ||
const dbs = [{"name": "maçã", "id": "9999994", "isUnicode": true}, { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dbs, validatorJson are also unused.
|
||
const jsunity = require('jsunity'); | ||
const {assertTrue, assertFalse, assertEqual, assertNotEqual, assertInstanceOf} = jsunity.jsUnity.assertions; | ||
const internal = require('internal'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
internal, isCluster, few of the asserts, etc. are also unused and can be removed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- please don't duplicate testfunctions, use the test-helper as utility file to share them
- use the client-tools to manage sub-processes. (asan, locating binaries ... all done for you)
assertTrue(fs.isFile(arangorestore), "arangorestore not found!"); | ||
|
||
let addConnectionArgs = function (args) { | ||
let endpoint = arango.getEndpoint().replace(/\+vpp/, '').replace(/^http:/, 'tcp:').replace(/^https:/, 'ssl:').replace(/^h2:/, 'tcp:'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you should be able to directly use the GLOBAL.instancemanager.endpoint
here.
const cn = 'UnitTestsVectorIndexRestore'; | ||
const arangorestore = pu.ARANGORESTORE_BIN; | ||
|
||
assertTrue(fs.isFile(arangorestore), "arangorestore not found!"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://github.com/arangodb/arangodb/blob/devel/js/client/modules/%40arangodb/testutils/client-tools.js#L53
the Config-builder and https://github.com/arangodb/arangodb/blob/devel/js/client/modules/%40arangodb/testutils/client-tools.js#L631 runArangoDumpRestore should be used.
Its usage can be seen in
https://github.com/arangodb/arangodb/blob/devel/js/client/modules/%40arangodb/testsuites/dump.js
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see runArangoDumpRestore
being used in the file you shared
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
its named arangoDumpRestoreWithConfig
through export logics.
return data; | ||
} | ||
|
||
function createDumpJsonFile(path, databaseName, id) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think instead of duplicating functions from tests/js/client/shell/shell-restore-integration.js
they rather should be moved out of it to js/client/modules/\@arangodb/test-helper.js
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Scope & Purpose
Fix restore with vector index when the feature is disabled. This previously crashed; now the vector indexes are ignored, restoration proceeds, and a message is logged.
Checklist
Related Information
(Please reference tickets / specification / other PRs etc)