From ccc339ca463ecee7d0f2eace04979dc7945fa85d Mon Sep 17 00:00:00 2001 From: Wilfried Goesgens Date: Mon, 30 Jul 2018 08:55:26 +0200 Subject: [PATCH] Feature 3.3/forward compatible sync (#6001) --- arangod/MMFiles/MMFilesIndexFactory.cpp | 2 +- arangod/Replication/TailingSyncer.cpp | 16 ++++++++++------ arangod/RestHandler/RestReplicationHandler.cpp | 10 ++++++++++ arangod/RocksDBEngine/RocksDBIndexFactory.cpp | 2 +- arangod/VocBase/KeyGenerator.cpp | 8 ++++++++ 5 files changed, 30 insertions(+), 8 deletions(-) diff --git a/arangod/MMFiles/MMFilesIndexFactory.cpp b/arangod/MMFiles/MMFilesIndexFactory.cpp index 694ba6888f..869fc3b6cd 100644 --- a/arangod/MMFiles/MMFilesIndexFactory.cpp +++ b/arangod/MMFiles/MMFilesIndexFactory.cpp @@ -398,7 +398,7 @@ std::shared_ptr MMFilesIndexFactory::prepareIndexFromSlice( } return std::make_shared(iid, col); } - if (typeString == "geo1" || typeString == "geo2") { + if (typeString == "geo1" || typeString == "geo2" || typeString == "geo") { return std::make_shared(iid, col, info); } if (typeString == "hash") { diff --git a/arangod/Replication/TailingSyncer.cpp b/arangod/Replication/TailingSyncer.cpp index 2baa77affc..c244d4e07f 100644 --- a/arangod/Replication/TailingSyncer.cpp +++ b/arangod/Replication/TailingSyncer.cpp @@ -719,18 +719,22 @@ Result TailingSyncer::applyLogMarker(VPackSlice const& slice, } else if (type == REPLICATION_VIEW_CREATE) { - THROW_ARANGO_EXCEPTION_MESSAGE(TRI_ERROR_NOT_IMPLEMENTED, - "view create not yet implemented"); + LOG_TOPIC(WARN, Logger::REPLICATION) << "views not supported in 3.3"; + return Result(); } else if (type == REPLICATION_VIEW_DROP) { - THROW_ARANGO_EXCEPTION_MESSAGE(TRI_ERROR_NOT_IMPLEMENTED, - "view drop not yet implemented"); + LOG_TOPIC(WARN, Logger::REPLICATION) << "views not supported in 3.3"; + return Result(); } else if (type == REPLICATION_VIEW_CHANGE) { - THROW_ARANGO_EXCEPTION_MESSAGE(TRI_ERROR_NOT_IMPLEMENTED, - "view change not yet implemented"); + LOG_TOPIC(WARN, Logger::REPLICATION) << "views not supported in 3.3"; + return Result(); + } + else if (type == REPLICATION_VIEW_RENAME) { + LOG_TOPIC(WARN, Logger::REPLICATION) << "views not supported in 3.3"; + return Result(); } else if (type == REPLICATION_DATABASE_CREATE || diff --git a/arangod/RestHandler/RestReplicationHandler.cpp b/arangod/RestHandler/RestReplicationHandler.cpp index 5fb2738c98..a429625c9e 100644 --- a/arangod/RestHandler/RestReplicationHandler.cpp +++ b/arangod/RestHandler/RestReplicationHandler.cpp @@ -352,6 +352,16 @@ RestStatus RestReplicationHandler::execute() { goto BAD_CALL; } handleCommandRestoreData(); + } else if (command == "restore-view") { + LOG_TOPIC(WARN, Logger::REPLICATION) << "views not supported in 3.3"; + if (type != rest::RequestType::PUT) { + goto BAD_CALL; + } + VPackBuilder result; + result.openObject(); + result.close(); + generateResult(rest::ResponseCode::OK, result.slice()); + return RestStatus::DONE; } else if (command == "sync") { if (type != rest::RequestType::PUT) { goto BAD_CALL; diff --git a/arangod/RocksDBEngine/RocksDBIndexFactory.cpp b/arangod/RocksDBEngine/RocksDBIndexFactory.cpp index f303aaf2be..b738a9fbf7 100644 --- a/arangod/RocksDBEngine/RocksDBIndexFactory.cpp +++ b/arangod/RocksDBEngine/RocksDBIndexFactory.cpp @@ -397,7 +397,7 @@ std::shared_ptr RocksDBIndexFactory::prepareIndexFromSlice( if (typeString == "persistent") { return std::make_shared(iid, col, info); } - if (typeString == "geo1" || typeString == "geo2") { + if (typeString == "geo1" || typeString == "geo2" || typeString == "geo") { return std::make_shared(iid, col, info); } if (typeString == "fulltext") { diff --git a/arangod/VocBase/KeyGenerator.cpp b/arangod/VocBase/KeyGenerator.cpp index 5c122c304c..315a1817ae 100644 --- a/arangod/VocBase/KeyGenerator.cpp +++ b/arangod/VocBase/KeyGenerator.cpp @@ -83,6 +83,14 @@ KeyGenerator::GeneratorType KeyGenerator::generatorType( if (typeName == AutoIncrementKeyGenerator::name()) { return KeyGenerator::TYPE_AUTOINCREMENT; } + if ((typeName == "uuid") || (typeName == "padded")) { + LOG_TOPIC(WARN, Logger::REPLICATION) << + "key generator '" << + typeName << + "' not supported in 3.3 - falling back to " << + TraditionalKeyGenerator::name(); + return KeyGenerator::TYPE_TRADITIONAL; + } // error return KeyGenerator::TYPE_UNKNOWN;