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
8000

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 8000 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
Diff view
Prev Previous commit
Next Next commit
adding inBackground flag
  • Loading branch information
graetzer committed Dec 11, 2018
commit ef4bb05b3d08ac2f93188fb72d07ac24d5aac577
4 changes: 2 additions & 2 deletions arangod/RestHandler/RestShutdownHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,12 +103,12 @@ RestStatus RestShutdownHandler::execute() {
rest::Scheduler* scheduler = SchedulerFeature::SCHEDULER;
// don't block the response for workers waiting on this callback
// this should allow workers to go into the IDLE state
scheduler->queue(RequestPriority::HIGH, [this] {
scheduler->queue(RequestPriority::HIGH, []{
// Give the server 2 seconds to send the reply:
std::this_thread::sleep_for(std::chrono::seconds(2));
// Go down:
ApplicationServer::server->beginShutdown();
});
});

return RestStatus::DONE;
}
16 changes: 10 additions & 6 deletions arangod/RocksDBEngine/RocksDBCollection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -417,17 +417,21 @@ std::shared_ptr<Index> RocksDBCollection::createIndex(

// Step 5. cleanup
if (res.ok()) {
{ // swap in actual index
{
WRITE_LOCKER(indexGuard, _indexesLock);
for (size_t i = 0; i < _indexes.size(); i++) {
if (_indexes[i]->id() == buildIdx->id()) {
_indexes[i] = idx;
break;
if (inBackground) { // swap in actual index
for (size_t i = 0; i < _indexes.size(); i++) {
if (_indexes[i]->id() == buildIdx->id()) {
_indexes[i] = idx;
break;
}
}
} else {
_indexes.push_back(idx);
}
}

// we should sync the selectivity estimates
// we should sync the selectivity estimates TODO fix
res = engine->settingsManager()->sync(false);
if (res.fail()) { // not critical
LOG_TOPIC(WARN, Logger::ENGINES) << "could not sync settings: "
Expand Down
13 changes: 6 additions & 7 deletions tests/js/common/shell/shell-index-rocksdb.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
///
/// DISCLAIMER
///
/// Copyright 2010-2012 triagens GmbH, Cologne, Germany
/// Copyright 2018 ArangoDB 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.
Expand All @@ -22,10 +22,9 @@
/// See the License for the specific language governing permissions and
/// limitations under the License.
///
/// Copyright holder is triAGENS GmbH, Cologne, Germany
/// Copyright holder is ArangoDB GmbH, Cologne, Germany
///
/// @author Dr. Frank Celler, Lucas Dohmen
/// @author Copyright 2012, triAGENS GmbH, Cologne, Germany
/// @author 2018 Simon Grätzer, Dan Larkin-York
////////////////////////////////////////////////////////////////////////////////

const jsunity = require("jsunity");
Expand Down Expand Up @@ -104,7 +103,7 @@ function backgroundIndexSuite() {
}

// create the index on the main thread
c.ensureIndex({type: 'hash', fields: ['value'], unique: false});
c.ensureIndex({type: 'hash', fields: ['value'], unique: false, inBackground: true});

// wait for insertion tasks to complete
waitForTasks();
Expand Down Expand Up @@ -168,7 +167,7 @@ function backgroundIndexSuite() {
}

// create the index on the main thread
c.ensureIndex({type: 'hash', fields: ['value'], unique: true});
c.ensureIndex({type: 'hash', fields: ['value'], unique: true, inBackground: true });

// wait for insertion tasks to complete
waitForTasks();
Expand Down Expand Up @@ -229,7 +228,7 @@ function backgroundIndexSuite() {

try {
// create the index on the main thread
c.ensureIndex({type: 'hash', fields: ['value'], unique: true});
c.ensureIndex({type: 'hash', fields: ['value'], unique: true, inBackground: true});
fail();
} catch(err) {
assertEqual(errors.ERROR_ARANGO_UNIQUE_CONSTRAINT_VIOLATED.code, err.errorNum, err);
Expand Down
0