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
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
Diff view
Prev Previous commit
Next Next commit
remove unused code
  • Loading branch information
graetzer committed Dec 6, 2018
commit b5257126df049d698683e8d63e9b4693dc486833
45 changes: 6 additions & 39 deletions arangod/RocksDBEngine/RocksDBBuilderIndex.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,11 @@ Result RocksDBBuilderIndex::removeInternal(transaction::Methods* trx, RocksDBMet
arangodb::Result RocksDBBuilderIndex::fillIndexBackground(std::function<void()> const& unlock) {
arangodb::Result res;

// 1. Index everything under a snapshot iterator (get snapshot under exclusive coll lock)
// 2. Track deleted document IDs so we can avoid indexing them
// 3. Avoid conflicts on unique index keys by using rocksdb::Transaction snapshot conflict checking
// 4. Supress unique constraint violations / conflicts or client drivers

// fillindex can be non transactional, we just need to clean up
RocksDBEngine* engine = rocksutils::globalRocksEngine();
RocksDBCollection* rcoll = static_cast<RocksDBCollection*>(_collection.getPhysical());
Expand Down Expand Up @@ -169,7 +174,7 @@ arangodb::Result RocksDBBuilderIndex::fillIndexBackground(std::function<void()>
std::unique_ptr<rocksdb::Transaction> rtrx(engine->db()->BeginTransaction(wo, to));
if (this->unique()) {
rtrx->SetSnapshot(); // needed for unique index conflict detection
} else { // FIXME use PutUntracked
} else {
rtrx->DisableIndexing(); // we never check for existing index keys
}
RocksDBSubTrxMethods batched(state, rtrx.get());
Expand Down Expand Up @@ -222,32 +227,6 @@ arangodb::Result RocksDBBuilderIndex::fillIndexBackground(std::function<void()>

it->Next();
}
//
// if (res.ok() && !toRevisit.empty()) { // now roll-up skipped keys
// to.lock_timeout = 5000; // longer timeout to increase the odds
// engine->db()->BeginTransaction(wo, to, rtrx.get()); // release keys
// rtrx->SetSnapshot();
// RocksDBKey key;
//
// for (LocalDocumentId const& doc : toRevisit) {
// key.constructDocument(coll->objectId(), doc);
//
// rocksdb::PinnableSlice slice;
// s = rtrx->GetForUpdate(ro, docCF, key.string(), &slice, /*exclusive*/false);
// if (!s.ok()) {
// res = rocksutils::convertStatus(s, rocksutils::StatusHint::index);
// break;
// }
// res = ridx->insertInternal(&trx, &batched, doc,
// VPackSlice(slice.data()),
// Index::OperationMode::normal);
// if (res.fail()) {
// break;
// }
//
// numDocsWritten++;
// }
// }

// now actually write all remaining index keys
if (res.ok() && rtrx->GetNumPuts() > 0) {
Expand All @@ -264,18 +243,6 @@ arangodb::Result RocksDBBuilderIndex::fillIndexBackground(std::function<void()>
_lockedDocs.clear();
_lockedDocsCond.notify_all();

// we will need to remove index elements created before an error
// occurred, this needs to happen since we are non transactional
// if (res.fail()) {
// RocksDBKeyBounds bounds = internal->getBounds();
// arangodb::Result res2 = rocksutils::removeLargeRange(rocksutils::globalRocksDB(), bounds,
// true, /*useRangeDel*/numDocsWritten > 25000);
// if (res2.fail()) {
// LOG_TOPIC(WARN, Logger::ENGINES) << "was not able to roll-back "
// << "index creation: " << res2.errorMessage();
// }
// }

return res;
}

Expand Down
0