8000 Bug fix 3.5/internal issue #651 by gnusi · Pull Request #10388 · arangodb/arangodb · GitHub
[go: up one dir, main page]

Skip to content

Bug fix 3.5/internal issue #651 #10388

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 24 commits into from
Nov 12, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
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
backport changes from 3.5.2
  • Loading branch information
gnusi committed Nov 9, 2019
commit 32746571cf9513544a2528a58c25163d600b533c
1 change: 1 addition & 0 deletions arangod/Aql/QueryString.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ class QueryString {
~QueryString() = default;

public:
std::string const& string() const noexcept { return _queryString; }
char const* data() const { return _queryString.data(); }
size_t size() const { return _queryString.size(); }
size_t length() const { return _queryString.size(); }
Expand Down
25 changes: 12 additions & 13 deletions arangod/IResearch/IResearchAnalyzerFeature.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -579,9 +579,9 @@ arangodb::Result visitAnalyzers(
TRI_vocbase_t& vocbase,
std::function<arangodb::Result(VPackSlice const&)> const& visitor) {
static const auto resultVisitor = [](
std::function<arangodb::Result(VPackSlice const&)> const& visitor,
TRI_vocbase_t const& vocbase,
VPackSlice const& slice) -> arangodb::Result {
std::function<arangodb::Result(VPackSlice const&)> const& visitor,
TRI_vocbase_t const& vocbase,
VPackSlice const& slice) -> arangodb::Result {
if (!slice.isArray()) {
return {
TRI_ERROR_INTERNAL,
Expand Down Expand Up @@ -1439,16 +1439,16 @@ AnalyzerPool::ptr IResearchAnalyzerFeature::get(

Result IResearchAnalyzerFeature::loadAnalyzers(
irs::string_ref const& database /*= irs::string_ref::NIL*/) {
try {
auto* dbFeature = application_features::ApplicationServer::lookupFeature<DatabaseFeature>("Database");
auto* dbFeature = application_features::ApplicationServer::lookupFeature<DatabaseFeature>("Database");

if (!dbFeature) {
return {
TRI_ERROR_INTERNAL,
"failure to find feature 'Database' while loading analyzers for database '" + std::string(database)+ "'"
};
}
if (!dbFeature) {
return {
TRI_ERROR_INTERNAL,
"failure to find feature 'Database' while loading analyzers for database '" + std::string(database)+ "'"
};
}

try {
WriteMutex mutex(_mutex);
SCOPED_LOCK(mutex); // '_analyzers'/'_lastLoad' can be asynchronously read

Expand Down Expand Up @@ -1531,8 +1531,7 @@ Result IResearchAnalyzerFeature::loadAnalyzers(
return {}; // do not reload on single-server
}
} else if (itr != _lastLoad.end() // had a previous load
&& itr->second + RELOAD_INTERVAL > currentTimestamp // timeout not reached
) {
&& itr->second + RELOAD_INTERVAL > currentTimestamp) { // timeout not reached
return {}; // reload interval not reached
}

Expand Down
0