8000 using lookahead in zkd by romanatarango · Pull Request #14745 · arangodb/arangodb · GitHub
[go: up one dir, main page]

Skip to content

using lookahead in zkd #14745

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 68 commits into from
Jan 5, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
68 commits
Select commit Hold shift + click to select a range
c19d549
Bootstrap zkd indexes. Now fill in the details.
Mar 3, 2021
60d6ceb
Added prototype for condition finder.
Mar 4, 2021
63fd0b7
Added helper for Range.
Mar 4, 2021
a43cf14
Fixed double conversion.
Mar 4, 2021
9305dbc
Added wrong but working nextImpl
Mar 5, 2021
14ba135
Extract bounds for iterator.
Mar 5, 2021
3d7d5fc
Fixed extraction logic with reversed operator usage.
Mar 5, 2021
db52b6d
Detect equal operator correctly.
Mar 5, 2021
ede46db
Implemented nextImpl
goedderz Mar 5, 2021
5c78b96
Removed log devel for hot path.
Mar 5, 2021
0b73dcf
Cleanup
goedderz Mar 5, 2021
4fb378c
Added support for partially unbounded queries.
Mar 5, 2021
6948eb6
Do not use index for full collection scans.
Mar 5, 2021
34117f4
Merge branch 'feature/zkd-index' of github.com:arangodb/arangodb into…
Mar 5, 2021
59fd78e
Added tests for ZkdHelper.
Mar 8, 2021
db392e3
Added functional test suite skeleton for zkd index
8000 goedderz Mar 8, 2021
811e660
Merge remote-tracking branch 'origin/devel' into feature/zkd-index
Mar 8, 2021
91f5651
Some fixes to double conversions
goedderz Mar 8, 2021
5be1cd2
Fixed bug in double to byte_string conversion.
Mar 8, 2021
34c4324
Added support for denormalized doubles and infinity.
Mar 9, 2021
e2977ff
Test all interesting double values.
Mar 9, 2021
c9042d2
Disallow Nan.
Mar 9, 2021
dd3b8f2
Added more js tests.
Mar 9, 2021
7b879dc
Added a lot of tests.
Mar 9, 2021
6fcf4d1
Cleaned up test.
Mar 9, 2021
5697c52
[zkd] Strict comparsion (#13673)
Mar 10, 2021
1d3522d
[zkd] Cluster support (#13677)
Mar 11, 2021
94dd02e
Merge remote-tracking branch 'origin/devel' into feature/zkd-index
Mar 11, 2021
3d1ce4b
Added support for nested fields - excluding expansions. (#13681)
Mar 11, 2021
7618470
[zkd] Unique Constraints (#13691)
Mar 12, 2021
1d4928b
[zkd] Forward Compat (#13694)
Mar 15, 2021
8cabd6f
[zkd] Column Family (#13692)
Mar 15, 2021
bbf25b4
Added zkd index docu block. (#13698)
Mar 15, 2021
caa87ae
Fixed bug in RocksDBKeyBounds and using default cost estimation
Mar 16, 2021
6c6a34e
Merge remote-tracking branch 'origin/devel' into feature/zkd-index
Mar 22, 2021
b81f948
[zkd] testInBox speedup (#13798)
Mar 24, 2021
aaddb71
Feature/zkd index speedup getnextzvalue (#13799)
goedderz Mar 25, 2021
10ed61a
Merge remote-tracking branch 'origin/devel' into feature/zkd-index
May 25, 2021
5a1adc3
Merge remote-tracking branch 'origin/devel' into feature/zkd-index
May 26, 2021
584f524
Merge remote-tracking branch 'origin/devel' into feature/zkd-index
Jul 1, 2021
d650d3f
Updated CHANGELOG.
Jul 1, 2021
265ed5c
Merge branch 'devel' of github.com:arangodb/arangodb into feature/zkd…
goedderz Jul 6, 2021
3c73e3d
Merge remote-tracking branch 'origin/devel' into feature/zkd-index
Jul 15, 2021
41ea5e2
Merge remote-tracking branch 'origin/devel' into feature/zkd-index
Aug 5, 2021
fa7d8b0
Fixing iterator.
Aug 6, 2021
5f83c9f
Merge remote-tracking branch 'origin/devel' into feature/zkd-index
Aug 12, 2021
dd48bf9
Added review suggestions.
Aug 20, 2021
875c5ae
using lookahead in zkd
romanatarango Sep 7, 2021
4b94de7
added forgotten declaration
romanatarango Sep 8, 2021
a49a331
added forgotten condering of the new option
romanatarango Sep 8, 2021
a55c4c6
Merge remote-tracking branch 'origin/devel' into feature/zkd-index
Sep 9, 2021
60473c5
Applied suggestions from review.
Sep 9, 2021
a185712
Merge branch 'devel' into feature/zkd-index
mchacki Sep 10, 2021
abc823e
Merge commit '8c2374f95334ba0d48ef72ca1fd0784c7150ad1c' into tmp
romanatarango Sep 13, 2021
98e09f4
Merge remote-tracking branch 'origin/feature/zkd-index' into feature/…
romanatarango Sep 13, 2021
3927a6c
Merge branch 'tmp' into feature/zkd-index-lookahead
romanatarango Sep 13, 2021
69311a0
Merge remote-tracking branch 'origin/devel' into feature/zkd-index-lo…
romanatarango Sep 13, 2021
95767fc
8000 removed tryNewIndex option, now decided by lookahead==0
romanatarango Sep 13, 2021
703c6d4
Merge remote-tracking branch 'origin/devel' into feature/zkd-index-lo…
Oct 6, 2021
d4aa992
Merge remote-tracking branch 'origin' into feature/zkd-index-lookahead
romanatarango Nov 5, 2021
8fca628
Merge branch 'feature/zkd-index-lookahead' of github.com:arangodb/ara…
romanatarango Nov 5, 2021
723d0a8
Merge remote-tracking branch 'origin' into feature/zkd-index-lookahead
romanatarango Nov 5, 2021
40673ae
unified default lookaheads for zkd to 1, made one of them const
romanatarango Nov 5, 2021
fac0505
added testing with lookahead 32 in aql-optimizer-zkdindex-multi.js
romanatarango Nov 8, 2021
0fac8b7
Merge commit 'dc6bbbf2dc552fba751e7f818a69d851393b496a' into feature/…
Jan 4, 2022
87a7a5f
Applied clang-format
Jan 4, 2022
2884250
Merge commit 'a6bd3ccd6f622fab2a288d2e3a06ab8e338d3ec1' into feature/…
Jan 4, 2022
3380e72
Merge branch 'devel' of github.com:arangodb/arangodb into feature/zkd…
Jan 4, 2022
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
Merge remote-tracking branch 'origin/devel' into feature/zkd-index
  • Loading branch information
maierlars committed Aug 12, 2021
commit 5f83c9f9c7e8033675ded81c80ee6b5ac92d1b37
32 changes: 32 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,38 @@ devel
The index implements the relation <=, == and >= natively. Strict relations are
emulated using post filtering. Ranges can be unbounded on one or both sides.

* Add ReplicatedLogs column family.

* Add optimization rule for AqlAnalyzer.

* Fixed issue #14592: IS_NULL(@x) isn't recognized as a constant expression.

* Fixed issue BTS-539 "Unsynchronized query kill while it's being finalized in
another thread was uncovered through `test-kill.js` of `communication_ssl`
suite". Fixed possible (but unlikely) crash when killing an AQL query.

* Append physical compaction of log collection to every Raft log
compaction (BTS-542).

* Change optimization level for debug builds back to `-O0` (from `-Og`)
because `-Og` seems to cause debuggability issues in some environments.

* Fixed issue BTS-536 "Upgrading without rest-server is aborted by error".
Now stating `--server.rest-server false` does not require the additional
`--console` argument for upgrading a server.

* Fixed various problems in GEO_INTERSECTS: wrong results, not implemented
cases and numerically unstable behaviour. In particular, the case of
the intersection of two polygons in which one is an S2LngLatRect
is fixed (BTS-475).

* Fixed ES-867 and ES-922: removed eslint from NPM packages descriptions and
updated netmask package to non-vulnerable version.

* Web UI: Fixes a logical error which occured after re-visiting the logs view
which lead to not displaying the logs view and its entries correctly
(BTS-507).

* Fixed a bug, where Coordinators handled plan changes for databases
in heartbeat thread in wrong order. Databases could be listed, but
not used.
Expand Down
3 changes: 2 additions & 1 deletion arangod/RocksDBEngine/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,9 @@ set(ROCKSDB_SOURCES
RocksDBEngine/RocksDBLogValue.cpp
RocksDBEngine/RocksDBMetaCollection.cpp
RocksDBEngine/RocksDBMetadata.cpp
RocksDBEngine/RocksDBTransactionMethods.cpp
RocksDBEngine/RocksDBOptimizerRules.cpp
RocksDBEngine/RocksDBOptionFeature.cpp
RocksDBEngine/RocksDBPersistedLog.cpp
RocksDBEngine/RocksDBPrimaryIndex.cpp
RocksDBEngine/RocksDBRecoveryManager.cpp
RocksDBEngine/RocksDBReplicationCommon.cpp
Expand All @@ -90,6 +90,7 @@ set(ROCKSDB_SOURCES
RocksDBEngine/RocksDBSettingsManager.cpp
RocksDBEngine/RocksDBSyncThread.cpp
RocksDBEngine/RocksDBTransactionCollection.cpp
RocksDBEngine/RocksDBTransactionMethods.cpp
RocksDBEngine/RocksDBTransactionState.cpp
RocksDBEngine/RocksDBTtlIndex.cpp
RocksDBEngine/RocksDBTypes.cpp
Expand Down
18 changes: 10 additions & 8 deletions arangod/RocksDBEngine/RocksDBColumnFamilyManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,19 @@

namespace arangodb {

std::array<char const*, arangodb::RocksDBColumnFamilyManager::numberOfColumnFamilies>
RocksDBColumnFamilyManager::_internalNames = {"default", "Documents",
"PrimaryIndex", "EdgeIndex",
"VPackIndex", "GeoIndex",
"FulltextIndex", "ZkdIndex"};
std::array<char const*, arangodb::RocksDBColumnFamilyManager::numberOfColumnFamilies> RocksDBColumnFamilyManager::_internalNames =
{"default", "Documents", "PrimaryIndex",
"EdgeIndex", "VPackIndex", "GeoIndex",
"FulltextIndex", "ReplicatedLogs", "ZkdIndex"};

std::array<char const*, arangodb::RocksDBColumnFamilyManager::numberOfColumnFamilies> RocksDBColumnFamilyManager::_externalNames =
{"definitions", "documents", "primary", "edge", "vpack", "geo", "fulltext", "zkd"};
{"definitions", "documents", "primary", "edge", "vpack",
"geo", "fulltext", "replicated-logs", "zkd"};

std::array<rocksdb::ColumnFamilyHandle*, RocksDBColumnFamilyManager::numberOfColumnFamilies>
RocksDBColumnFamilyManager::_handles = {nullptr, nullptr, nullptr, nullptr,
nullptr, nullptr, nullptr, nullptr};
RocksDBColumnFamilyManager::_handles = {nullptr, nullptr, nullptr,
nullptr, nullptr, nullptr,
nullptr, nullptr, nullptr};

rocksdb::ColumnFamilyHandle* RocksDBColumnFamilyManager::_defaultHandle = nullptr;

Expand Down
7 changes: 4 additions & 3 deletions arangod/RocksDBEngine/RocksDBColumnFamilyManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ struct RocksDBColumnFamilyManager {
VPackIndex = 4, // persistent, "skiplist", "hash"
GeoIndex = 5,
FulltextIndex = 6,
ZkdIndex = 7,
ReplicatedLogs = 7,
ZkdIndex = 8,

Invalid = 1024 // special placeholder
};
Expand All @@ -55,8 +56,8 @@ struct RocksDBColumnFamilyManager {
External // for display to users
};

static constexpr size_t minNumberOfColumnFamilies = 8;
static constexpr size_t numberOfColumnFamilies = 8;
static constexpr size_t minNumberOfColumnFamilies = 7;
static constexpr size_t numberOfColumnFamilies = 9;

static void initialize();

Expand Down
12 changes: 8 additions & 4 deletions arangod/RocksDBEngine/RocksDBEngine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -706,9 +706,9 @@ void RocksDBEngine::start() {
addFamily(RocksDBColumnFamilyManager::Family::VPackIndex);
addFamily(RocksDBColumnFamilyManager::Family::GeoIndex);
addFamily(RocksDBColumnFamilyManager::Family::FulltextIndex);
addFamily(RocksDBColumnFamilyManager::Family::ReplicatedLogs);
addFamily(RocksDBColumnFamilyManager::Family::ZkdIndex);


size_t const minNumberOfColumnFamilies = RocksDBColumnFamilyManager::minNumberOfColumnFamilies;
bool dbExisted = false;
{
Expand Down Expand Up @@ -746,15 +746,17 @@ void RocksDBEngine::start() {
<< "found existing column families: " << names;
auto const replicatedLogsName = RocksDBColumnFamilyManager::name(
RocksDBColumnFamilyManager::Family::ReplicatedLogs);
auto const zkdIndexName = RocksDBColumnFamilyManager::name(
RocksDBColumnFamilyManager::Family::ReplicatedLogs);

for (auto const& it : cfFamilies) {
auto it2 = std::find(existingColumnFamilies.begin(),
existingColumnFamilies.end(), it.name);
if (it2 == existingColumnFamilies.end()) {

if (it.name == replicatedLogsName) {
if (it.name == replicatedLogsName || it.name == zkdIndexName) {
LOG_TOPIC("293c3", INFO, Logger::STARTUP)
<< "column family " << replicatedLogsName
<< "column family " << it.name
<< " is missing and will be created.";
continue;
}
Expand Down Expand Up @@ -834,8 +836,10 @@ void RocksDBEngine::start() {
cfHandles[5]);
RocksDBColumnFamilyManager::set(RocksDBColumnFamilyManager::Family::FulltextIndex,
cfHandles[6]);
RocksDBColumnFamilyManager::set(RocksDBColumnFamilyManager::Family::ZkdIndex,
RocksDBColumnFamilyManager::set(RocksDBColumnFamilyManager::Family::ReplicatedLogs,
cfHandles[7]);
RocksDBColumnFamilyManager::set(RocksDBColumnFamilyManager::Family::ZkdIndex,
cfHandles[8]);
TRI_ASSERT(RocksDBColumnFamilyManager::get(RocksDBColumnFamilyManager::Family::Definitions)
->GetID() == 0);

Expand Down
12 changes: 12 additions & 0 deletions arangod/RocksDBEngine/RocksDBKey.h
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,12 @@ class RocksDBKey {
void constructZkdIndexValue(uint64_t objectId, const zkd::byte_string& value);
void constructZkdIndexValue(uint64_t objectId, const zkd::byte_string& value, LocalDocumentId documentId);

//////////////////////////////////////////////////////////////////////////////
/// @brief Create a fully-specified key for revision tree for a collection
//////////////////////////////////////////////////////////////////////////////
void constructLogEntry(uint64_t objectId, replication2::LogIndex idx);


public:
//////////////////////////////////////////////////////////////////////////////
/// @brief Extracts the type from a key
Expand Down Expand Up @@ -288,6 +294,12 @@ class RocksDBKey {
//////////////////////////////////////////////////////////////////////////////
static zkd::byte_string_view zkdIndexValue(rocksdb::Slice const& slice);

//////////////////////////////////////////////////////////////////////////////
/// @brief Extracts log index from key
//////////////////////////////////////////////////////////////////////////////
static replication2::LogIndex logIndex(RocksDBKey const&);
static replication2::LogIndex logIndex(rocksdb::Slice const&);

/// size of internal objectID
static constexpr size_t objectIdSize() { return sizeof(uint64_t); }

Expand Down
2 changes: 2 additions & 0 deletions arangod/RocksDBEngine/RocksDBKeyBounds.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,8 @@ rocksdb::ColumnFamilyHandle* RocksDBKeyBounds::columnFamily() const {
return RocksDBColumnFamilyManager::get(RocksDBColumnFamilyManager::Family::GeoIndex);
case RocksDBEntryType::ZkdIndexValue:
return RocksDBColumnFamilyManager::get(RocksDBColumnFamilyManager::Family::ZkdIndex);
case RocksDBEntryType::LogEntry:
return RocksDBColumnFamilyManager::get(RocksDBColumnFamilyManager::Family::ReplicatedLogs);
case RocksDBEntryType::Database:
case RocksDBEntryType::Collection:
case RocksDBEntryType::CounterValue:
Expand Down
3 changes: 2 additions & 1 deletion arangod/RocksDBEngine/RocksDBOptionFeature.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -636,7 +636,8 @@ rocksdb::ColumnFamilyOptions RocksDBOptionFeature::columnFamilyOptions(
case RocksDBColumnFamilyManager::Family::PrimaryIndex:
case RocksDBColumnFamilyManager::Family::GeoIndex:
case RocksDBColumnFamilyManager::Family::FulltextIndex:
case RocksDBColumnFamilyManager::Family::ZkdIndex: {
case RocksDBColumnFamilyManager::Family::ZkdIndex:
case RocksDBColumnFamilyManager::Family::ReplicatedLogs: {
// fixed 8 byte object id prefix
options.prefix_extractor = std::shared_ptr<rocksdb::SliceTransform const>(
rocksdb::NewFixedPrefixTransform(RocksDBKey::objectIdSize()));
Expand Down
8 changes: 8 additions & 0 deletions arangod/RocksDBEngine/RocksDBTypes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,10 @@ char const* arangodb::rocksDBEntryTypeName(arangodb::RocksDBEntryType type) {
return "ZkdIndexValue";
case arangodb::RocksDBEntryType::UniqueZkdIndexValue:
return "UniqueZkdIndexValue";
case RocksDBEntryType::LogEntry:
return "ReplicatedLogEntry";
case RocksDBEntryType::ReplicatedLog:
return "ReplicatedLog";
}
return "Invalid";
}
Expand Down Expand Up @@ -263,6 +267,10 @@ rocksdb::Slice const& arangodb::rocksDBSlice(RocksDBEntryType const& type) {
return ZdkIndexValue;
case RocksDBEntryType::UniqueZkdIndexValue:
return UniqueZdkIndexValue;
case RocksDBEntryType::LogEntry:
return LogEntry;
case RocksDBEntryType::ReplicatedLog:
return ReplicatedLog;
}

return Placeholder; // avoids warning - errorslice instead ?!
Expand Down
7 changes: 4 additions & 3 deletions arangod/RocksDBEngine/RocksDBTypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,13 @@ enum class RocksDBEntryType : char {
KeyGeneratorValue = '=',
View = '>',
GeoIndexValue = '?',
ZkdIndexValue = 'z',
UniqueZkdIndexValue = 'Z',
LogEntry = 'L',
// RevisionTreeValue = '@', // pre-3.8 GA revision trees. do not use or reuse!
// RevisionTreeValue = '/', // pre-3.8 GA revision trees. do not use or reuse!
RevisionTreeValue = '*',
ReplicatedLog = 'l'
ReplicatedLog = 'l',
ZkdIndexValue = 'z',
UniqueZkdIndexValue = 'Z',
};

char const* rocksDBEntryTypeName(RocksDBEntryType);
Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.
0