8000 Rdb index background (preliminary) by graetzer · Pull Request #7644 · arangodb/arangodb · GitHub
[go: up one dir, main page]

Skip to content

Rdb index background (preliminary) #7644

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

Merged
merged 39 commits into from
Dec 21, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
3f6967c
Initial commit
graetzer Dec 3, 2018
38b3500
make sure index is hidden
graetzer Dec 3, 2018
0ddb321
Merge branch 'devel' of github.com:arangodb/arangodb into feature/rdb…
graetzer Dec 4, 2018
9bcc737
last changes
graetzer Dec 4, 2018
c57de4f
fix a bug
graetzer Dec 4, 2018
c798357
reduce conflicts
graetzer Dec 5, 2018
4766900
fix background indexing
graetzer Dec 6, 2018
b525712
remove unused code
graetzer Dec 6, 2018
0515650
fix link creation
graetzer Dec 6, 2018
70ef2f1
fix unique constraint violations
graetzer Dec 6, 2018
e6d23c1
fixed arangosearch cluster reporting
graetzer Dec 6, 2018
13bcd44
added test
graetzer Dec 6, 2018
9e5f960
fix test
graetzer Dec 6, 2018
6bfd840
make noncluster for now
graetzer Dec 6, 2018
3d20521
fix jslint
graetzer Dec 7, 2018
38005e0
Some test adjustments.
Dec 10, 2018
dc041fb
Merge branch 'devel' into feature/rdb-index-background
Dec 10, 2018
a7ae28a
Fix merge error.
Dec 10, 2018
db46a40
changes
graetzer Dec 10, 2018
9db5709
Merge branch 'feature/rdb-index-background' of github.com:arangodb/ar…
graetzer Dec 10, 2018
ef4bb05
adding inBackground flag
graetzer Dec 11, 2018
5546745
Merge branch 'devel' into feature/rdb-index-background
Dec 11, 2018
2ebf591
Fix merge errors.
Dec 11, 2018
2082f78
adding some docs
graetzer Dec 12, 2018
3efc632
Merge branch 'devel' into feature/rdb-index-background
Dec 12, 2018
98ddd16
Some small changes.
Dec 12, 2018
ee51fa5
Fixed removal bug and added test.
Dec 12, 2018
422e0ce
Added update test.
Dec 17, 2018
31d9d7b
Merge branch 'devel' of github.com:arangodb/arangodb into feature/rdb…
graetzer Dec 18, 2018
a34f928
forgot to comment out docs
graetzer Dec 18, 2018
021453c
fixing some code
graetzer Dec 19, 2018
f61b5e9
fix jslint
graetzer Dec 19, 2018
b013b15
remove some code
graetzer Dec 19, 2018
82f4b6e
fix reporting of unfinished indexes
graetzer Dec 20, 2018
b7d6a9d
Merge branch 'devel' of github.com:arangodb/arangodb into feature/rdb…
graetzer Dec 20, 2018
2f1cc80
fixing fillIndex for iresearch
graetzer Dec 21, 2018
371c738
revert a change
graetzer Dec 21, 2018
7f4e2e7
Merge branch 'devel' of github.com:arangodb/arangodb into feature/rdb…
graetzer Dec 21, 2018
3f46816
fixng a deadlock
graetzer Dec 21, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
8000
Diff view
Prev Previous commit
Next Next commit
fixed arangosearch cluster reporting
  • Loading branch information
graetzer committed Dec 6, 2018
commit e6d23c17881f6374864b891286571650122ac0de
5 changes: 5 additions & 0 deletions arangod/IResearch/IResearchLink.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,11 @@ bool IResearchLink::isSorted() const {
return false; // iResearch does not provide a fixed default sort order
}

bool IResearchLink::isHidden() const {
// hide links unless we are on a DBServer
return !arangodb::ServerState::instance()->isDBServer();
}

bool IResearchLink::json(arangodb::velocypack::Builder& builder) const {
if (!builder.isOpenObject() || !_meta.json(builder)) {
return false;
Expand Down
4 changes: 1 addition & 3 deletions arangod/IResearch/IResearchLink.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,7 @@ class IResearchLink {

bool isSorted() const; // arangodb::Index override

bool isHidden() const { // arangodb::Index override
return true; // always hide links
}
bool isHidden() const; // arangodb::Index override

////////////////////////////////////////////////////////////////////////////////
/// @brief the identifier for this link
Expand Down
131 changes: 131 additions & 0 deletions tests/js/common/shell/shell-index-rocksdb.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
/*jshint globalstrict:false, strict:false */
/*global fail, assertEqual, assertNotEqual, assertTrue, assertFalse */

////////////////////////////////////////////////////////////////////////////////
/// @brief test the index
///
/// @file
///
/// DISCLAIMER
///
/// Copyright 2010-2012 triagens GmbH, Cologne, Germany
///
/// Licensed under the Apache License, Version 2.0 (the "License");
/// you may not use this file except in compliance with the License.
/// You may obtain a copy of the License at
///
/// http://www.apache.org/licenses/LICENSE-2.0
///
/// Unless required by applicable law or agreed to in writing, software
/// distributed under the License is distributed on an "AS IS" BASIS,
/// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
/// See the License for the specific language governing permissions and
/// limitations under the License.
///
/// Copyright holder is triAGENS GmbH, Cologne, Germany
///
/// @author Dr. Frank Celler, Lucas Dohmen
/// @author Copyright 2012, triAGENS GmbH, Cologne, Germany
////////////////////////////////////////////////////////////////////////////////

var jsunity = require("jsunity");
var internal = require("internal");
var errors = internal.errors;
var testHelper = require("@arangodb/test-helper").Helper;

function backgroundIndexSuite() {
'use strict';
let cn = "UnitTestsCollectionIdx";
let tasks = require("@arangodb/tasks");

return {

setUp : function () {
internal.db._drop(cn);
internal.db._create(cn);
},

tearDown : function () {
tasks.get().forEach(function(task) {
if (task.id.match(/^UnitTest/) || task.name.match(/^UnitTest/)) {
try {
tasks.unregister(task);
}
catch (err) {
}
}
});
internal.db._drop(cn);
},

testInsertInParallel: function () {
let n = 10;
for (let i = 0; i < n; ++i) {
let command = `let c = require("internal").db._collection("${cn}");
let x = 25; while(x-- > 0) {
let docs = [];
for(let i = 0; i < 1000; i++) {
docs.push({value:i})
}
c.save(docs);
}`;
tasks.register({ name: "UnitTestsIndexInsert" + i, command: command });
}

let time = require("internal").time;
let start = time();
while (true) {
let indexes = require("internal").db._collection(cn).getIndexes();
if (indexes.length === n + 1) {
// primary index + user-defined indexes
break;
}
if (time() - start > 180) {
// wait for 3 minutes maximum
fail("Timeout creating 80 indices after 3 minutes: " + JSON.stringify(indexes));
}
require("internal").wait(0.5, false);
}

let indexes = require("internal").db._collection(cn).getIndexes();
assertEqual(n + 1, indexes.length);
},

testCreateInParallelDuplicate: function () {
let n = 100;
for (let i = 0; i < n; ++i) {
let command = 'require("internal").db._collection("' + cn + '").ensureIndex({ type: "hash", fields: ["value' + (i % 4) + '"] });';
tasks.register({ name: "UnitTestsIndexCreate" + i, command: command });
}

let time = require("internal").time;
let start = time();
while (true) {
let indexes = require("internal").db._collection(cn).getIndexes();
if (indexes.length === 4 + 1) {
// primary index + user-defined indexes
break;
}
if (time() - start > 180) {
// wait for 3 minutes maximum
fail("Timeout creating indices after 3 minutes: " + JSON.stringify(indexes));
}
require("internal").wait(0.5, false);
}

// wait some extra time because we just have 4 distinct indexes
// these will be created relatively quickly. by waiting here a bit
// we give the other pending tasks a chance to execute too (but they
// will not do anything because the target indexes already exist)
require("internal").wait(5, false);

let indexes = require("internal").db._collection(cn).getIndexes();
assertEqual(4 + 1, indexes.length);
}

};
}

jsunity.run(backgroundIndexSuite);

return jsunity.done();
0