From cb5493858280552263df67349f57d1fa0418b3f1 Mon Sep 17 00:00:00 2001 From: Wilfried Goesgens Date: Fri, 21 Apr 2017 14:22:56 +0200 Subject: [PATCH 1/6] also try to detect the icu database in its absolute install directory --- lib/ApplicationFeatures/LanguageFeature.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/ApplicationFeatures/LanguageFeature.cpp b/lib/ApplicationFeatures/LanguageFeature.cpp index b2bf0e9fa7..6802c7d277 100644 --- a/lib/ApplicationFeatures/LanguageFeature.cpp +++ b/lib/ApplicationFeatures/LanguageFeature.cpp @@ -69,7 +69,9 @@ void* LanguageFeature::prepareIcu(std::string const& binaryPath, std::string con if (path.empty() || !TRI_IsRegularFile(path.c_str())) { if (!path.empty()) { - LOG_TOPIC(WARN, arangodb::Logger::FIXME) << "failed to locate '" << fn << "' at '"<< path << "'"; + LOG_TOPIC(WARN, arangodb::Logger::FIXME) + << "failed to locate '" << fn + << "' at '"<< path << "'"; } std::string bpfn = binaryExecutionPath + TRI_DIR_SEPARATOR_STR + fn; @@ -83,6 +85,10 @@ void* LanguageFeature::prepareIcu(std::string const& binaryPath, std::string con std::string argv_0 = binaryExecutionPath + TRI_DIR_SEPARATOR_STR + binaryName; path = TRI_LocateInstallDirectory(argv_0.c_str(), binaryPath.c_str()); path += ICU_DESTINATION_DIRECTORY TRI_DIR_SEPARATOR_STR + fn; + if (!TRI_IsRegularFile(path.c_str())) { + // Try whether we have an absolute install prefix: + path = ICU_DESTINATION_DIRECTORY TRI_DIR_SEPARATOR_STR + fn; + } } if (!TRI_IsRegularFile(path.c_str())) { std::string msg = From 2b77bfcaaa88c7f816985eb682f0897298e134dd Mon Sep 17 00:00:00 2001 From: Wilfried Goesgens Date: Thu, 20 Apr 2017 10:24:31 +0200 Subject: [PATCH 2/6] fix snap package filename --- cmake/packages/snap.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/packages/snap.cmake b/cmake/packages/snap.cmake index 9b9230abb3..be5522b270 100644 --- a/cmake/packages/snap.cmake +++ b/cmake/packages/snap.cmake @@ -7,7 +7,7 @@ endif() if(SNAPCRAFT_FOUND) set(SNAPCRAFT_TEMPLATE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/Installation/Ubuntu") set(SNAPCRAFT_SOURCE_DIR "${CMAKE_BINARY_DIR}/_CPack_Packages/SNAP") - set(CPACK_SNAP_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}_${CPACK_PACKAGE_VERSION}-${ARANGODB_PACKAGE_REVISION}_${ARANGODB_PACKAGE_ARCHITECTURE}.snap") + set(CPACK_SNAP_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}_${CPACK_PACKAGE_VERSION}_${ARANGODB_PACKAGE_REVISION}_${ARANGODB_PACKAGE_ARCHITECTURE}.snap") message(STATUS "Creating snap package") From 5125f3e70aea515dfa9a3c17686f22aa7f54d8f8 Mon Sep 17 00:00:00 2001 From: Wilfried Goesgens Date: Thu, 20 Apr 2017 13:01:27 +0200 Subject: [PATCH 3/6] fix snap package filename --- cmake/packages/snap.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/packages/snap.cmake b/cmake/packages/snap.cmake index be5522b270..1e0c4e788e 100644 --- a/cmake/packages/snap.cmake +++ b/cmake/packages/snap.cmake @@ -7,7 +7,7 @@ endif() if(SNAPCRAFT_FOUND) set(SNAPCRAFT_TEMPLATE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/Installation/Ubuntu") set(SNAPCRAFT_SOURCE_DIR "${CMAKE_BINARY_DIR}/_CPack_Packages/SNAP") - set(CPACK_SNAP_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}_${CPACK_PACKAGE_VERSION}_${ARANGODB_PACKAGE_REVISION}_${ARANGODB_PACKAGE_ARCHITECTURE}.snap") + set(CPACK_SNAP_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}_${CPACK_PACKAGE_VERSION}_${ARANGODB_PACKAGE_ARCHITECTURE}.snap") message(STATUS "Creating snap package") From 3a1e65d53f05ac3401028bd7a7ecc6bd91bb8b38 Mon Sep 17 00:00:00 2001 From: Wilfried Goesgens Date: Fri, 21 Apr 2017 15:23:54 +0200 Subject: [PATCH 4/6] add test whether append to NULL works --- js/server/tests/aql/aql-functions-list.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/js/server/tests/aql/aql-functions-list.js b/js/server/tests/aql/aql-functions-list.js index 082cada00e..01995798bb 100644 --- a/js/server/tests/aql/aql-functions-list.js +++ b/js/server/tests/aql/aql-functions-list.js @@ -723,6 +723,7 @@ function ahuacatlListTestSuite () { for (var i = 0; i < 10; ++i) { collection.save({_key: "test" + i}); } + var bindVars = {"@collection" : collectionName}; var actual = getQueryResults("LET tmp = (FOR x IN @@collection RETURN x) RETURN APPEND([], tmp)", bindVars); assertEqual(actual.length, 1); @@ -759,6 +760,9 @@ function ahuacatlListTestSuite () { for (i = 0; i < 10; ++i) { assertEqual(actual[i]._key, "test" + i); } + + actual = getQueryResults("LET doc = DOCUMENT('nonexistantCollection/nonexistantDocument') RETURN append(doc.t,[1,2,2],True)") + assertEqual(actual[0], [1,2,2]); }, testAppendDocuments2 : function () { From 361d513087435e943e8f155bb351b23464a39198 Mon Sep 17 00:00:00 2001 From: jsteemann Date: Fri, 21 Apr 2017 15:28:29 +0200 Subject: [PATCH 5/6] re-enable user settings for RocksDB --- arangod/RocksDBEngine/RocksDBEngine.cpp | 4 +-- .../RocksDBOptionFeature.cpp | 36 +++++++++++-------- 2 files changed, 23 insertions(+), 17 deletions(-) diff --git a/arangod/RocksDBEngine/RocksDBEngine.cpp b/arangod/RocksDBEngine/RocksDBEngine.cpp index a167095839..67b5d10b57 100644 --- a/arangod/RocksDBEngine/RocksDBEngine.cpp +++ b/arangod/RocksDBEngine/RocksDBEngine.cpp @@ -158,7 +158,7 @@ void RocksDBEngine::start() { // options imported set by RocksDBOptionFeature auto* opts = ApplicationServer::getFeature( "RocksDBOption"); - /* + _options.write_buffer_size = static_cast(opts->_writeBufferSize); _options.max_write_buffer_number = static_cast(opts->_maxWriteBufferNumber); @@ -183,7 +183,7 @@ void RocksDBEngine::start() { static_cast(opts->_logFileTimeToRoll); _options.compaction_readahead_size = static_cast(opts->_compactionReadaheadSize); -*/ + _options.create_if_missing = true; _options.max_open_files = -1; _options.comparator = _cmp.get(); diff --git a/lib/ApplicationFeatures/RocksDBOptionFeature.cpp b/lib/ApplicationFeatures/RocksDBOptionFeature.cpp index 84233a9120..80ac5a8d3c 100644 --- a/lib/ApplicationFeatures/RocksDBOptionFeature.cpp +++ b/lib/ApplicationFeatures/RocksDBOptionFeature.cpp @@ -30,28 +30,34 @@ #include "ProgramOptions/Section.h" #include "RestServer/DatabasePathFeature.h" +#include + using namespace arangodb; using namespace arangodb::application_features; using namespace arangodb::options; + +namespace { +rocksdb::Options rocksDBDefaults; +} RocksDBOptionFeature::RocksDBOptionFeature( application_features::ApplicationServer* server) : application_features::ApplicationFeature(server, "RocksDBOption"), - _writeBufferSize(0), - _maxWriteBufferNumber(2), - _delayedWriteRate(2 * 1024 * 1024), - _minWriteBufferNumberToMerge(1), - _numLevels(4), - _maxBytesForLevelBase(256 * 1024 * 1024), - _maxBytesForLevelMultiplier(10), - _baseBackgroundCompactions(1), - _maxBackgroundCompactions(1), - _maxLogFileSize(0), - _keepLogFileNum(1000), - _logFileTimeToRoll(0), - _compactionReadaheadSize(0), - _verifyChecksumsInCompaction(true), - _optimizeFiltersForHits(true) { + _writeBufferSize(rocksDBDefaults.write_buffer_size), + _maxWriteBufferNumber(rocksDBDefaults.max_write_buffer_number), + _delayedWriteRate(rocksDBDefaults.delayed_write_rate), + _minWriteBufferNumberToMerge(rocksDBDefaults.min_write_buffer_number_to_merge), + _numLevels(rocksDBDefaults.num_levels), + _maxBytesForLevelBase(rocksDBDefaults.max_bytes_for_level_base), + _maxBytesForLevelMultiplier(rocksDBDefaults.max_bytes_for_level_multiplier), + _baseBackgroundCompactions(rocksDBDefaults.base_background_compactions), + _maxBackgroundCompactions(rocksDBDefaults.max_background_compactions), + _maxLogFileSize(rocksDBDefaults.max_log_file_size), + _keepLogFileNum(rocksDBDefaults.keep_log_file_num), + _logFileTimeToRoll(rocksDBDefaults.log_file_time_to_roll), + _compactionReadaheadSize(rocksDBDefaults.compaction_readahead_size), + _verifyChecksumsInCompaction(rocksDBDefaults.verify_checksums_in_compaction), + _optimizeFiltersForHits(rocksDBDefaults.optimize_filters_for_hits) { setOptional(true); requiresElevatedPrivileges(false); startsAfter("DatabasePath"); From efefb87d70e883f5f3d8c56be77740fbcd4bd772 Mon Sep 17 00:00:00 2001 From: jsteemann Date: Fri, 21 Apr 2017 15:30:53 +0200 Subject: [PATCH 6/6] jslint --- js/server/tests/aql/aql-functions-list.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/server/tests/aql/aql-functions-list.js b/js/server/tests/aql/aql-functions-list.js index 01995798bb..104d3a164f 100644 --- a/js/server/tests/aql/aql-functions-list.js +++ b/js/server/tests/aql/aql-functions-list.js @@ -761,7 +761,7 @@ function ahuacatlListTestSuite () { assertEqual(actual[i]._key, "test" + i); } - actual = getQueryResults("LET doc = DOCUMENT('nonexistantCollection/nonexistantDocument') RETURN append(doc.t,[1,2,2],True)") + actual = getQueryResults("LET doc = DOCUMENT('nonexistantCollection/nonexistantDocument') RETURN append(doc.t,[1,2,2], true)"); assertEqual(actual[0], [1,2,2]); },