diff --git a/helio b/helio index 51f9c8b913b4..90bc3cc6aabb 160000 --- a/helio +++ b/helio @@ -1 +1 @@ -Subproject commit 51f9c8b913b44cff65c7bebe0da19a5257f5070b +Subproject commit 90bc3cc6aabbffc8b274dc0f7801695d68658529 diff --git a/src/core/interpreter.cc b/src/core/interpreter.cc index 183ef16d3c21..ded0515fbbbe 100644 --- a/src/core/interpreter.cc +++ b/src/core/interpreter.cc @@ -923,7 +923,7 @@ std::optional> Interpreter::PrepareArgs() switch (lua_type(lua_, idx)) { case LUA_TNUMBER: if (lua_isinteger(lua_, idx)) { - blob_len += absl::AlphaNum{lua_tointeger(lua_, idx)}.size(); + blob_len += absl::AlphaNum(lua_tointeger(lua_, idx)).size(); } else { int fmt_len = absl::SNPrintF(tmpbuf, sizeof(tmpbuf), "%.17g", lua_tonumber(lua_, idx)); CHECK_GT(fmt_len, 0); diff --git a/src/core/search/base.h b/src/core/search/base.h index d81008f0a9d3..6528a4203b64 100644 --- a/src/core/search/base.h +++ b/src/core/search/base.h @@ -112,11 +112,17 @@ std::optional ParseNumericField(std::string_view value); suppress this false warning, we temporarily disable it around this block of code using GCC diagnostic directives. */ template std::optional EmptyAccessResult() { +#if !defined(__clang__) // GCC 13.1 throws spurious warnings around this code. #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wmaybe-uninitialized" +#endif + return InlinedVector{}; + +#if !defined(__clang__) #pragma GCC diagnostic pop +#endif } } // namespace dfly::search diff --git a/src/facade/dragonfly_listener.cc b/src/facade/dragonfly_listener.cc index f03a9dbe2660..ddde92164fda 100644 --- a/src/facade/dragonfly_listener.cc +++ b/src/facade/dragonfly_listener.cc @@ -401,8 +401,11 @@ DispatchTracker::DispatchTracker(absl::Span listeners, } void DispatchTracker::TrackOnThread() { - for (auto* listener : listeners_) - listener->TraverseConnectionsOnThread(absl::bind_front(&DispatchTracker::Handle, this)); + for (auto* listener : listeners_) { + listener->TraverseConnectionsOnThread( + [this](unsigned thread_index, util::Connection* conn) { Handle(thread_index, conn); }, + UINT32_MAX, nullptr); + } } bool DispatchTracker::Wait(absl::Duration duration) { diff --git a/src/facade/reply_builder.cc b/src/facade/reply_builder.cc index 3ae3d32783aa..18a0aee9fd61 100644 --- a/src/facade/reply_builder.cc +++ b/src/facade/reply_builder.cc @@ -30,13 +30,7 @@ namespace facade { namespace { -inline iovec constexpr IoVec(std::string_view s) { - iovec r{const_cast(s.data()), s.size()}; - return r; -} - constexpr char kCRLF[] = "\r\n"; -constexpr char kErrPref[] = "-ERR "; constexpr char kSimplePref[] = "+"; constexpr char kLengthPrefix[] = "$"; constexpr char kDoublePref[] = ","; diff --git a/src/server/acl/user.cc b/src/server/acl/user.cc index bc0e5e34b6bc..44cc8c478bdd 100644 --- a/src/server/acl/user.cc +++ b/src/server/acl/user.cc @@ -90,7 +90,12 @@ void User::Update(UpdateRequest&& req, const CategoryToIdxStore& cat_to_id, void User::SetPasswordHash(std::string_view password, bool is_hashed) { nopass_ = false; if (is_hashed) { - password_hashes_.insert(absl::HexStringToBytes(password)); + std::string binary; + if (absl::HexStringToBytes(password, &binary)) { + password_hashes_.insert(binary); + } else { + LOG(ERROR) << "Invalid password hash: " << password; + } return; } password_hashes_.insert(StringSHA256(password)); diff --git a/src/server/cluster/outgoing_slot_migration.cc b/src/server/cluster/outgoing_slot_migration.cc index e12d9a6bf72e..9e1db91bbdf0 100644 --- a/src/server/cluster/outgoing_slot_migration.cc +++ b/src/server/cluster/outgoing_slot_migration.cc @@ -261,7 +261,7 @@ void OutgoingMigration::SyncFb() { continue; } - OnAllShards([this](auto& migration) { migration->RunSync(); }); + OnAllShards([](auto& migration) { migration->RunSync(); }); if (cntx_.GetError()) { continue; diff --git a/src/server/journal/journal_test.cc b/src/server/journal/journal_test.cc index 7461f7a59cb2..b2e9f78bf201 100644 --- a/src/server/journal/journal_test.cc +++ b/src/server/journal/journal_test.cc @@ -35,7 +35,7 @@ template <> string ConCat(const CmdArgList& list) { struct EntryPayloadVisitor { void operator()(const Entry::Payload& p) { out->append(p.cmd).append(" "); - *out += visit([this](const auto& args) { return ConCat(args); }, p.args); + *out += visit([](const auto& args) { return ConCat(args); }, p.args); } string* out; diff --git a/src/server/main_service.cc b/src/server/main_service.cc index 2af84299892d..4f2ae3cc3a41 100644 --- a/src/server/main_service.cc +++ b/src/server/main_service.cc @@ -1486,7 +1486,7 @@ void Service::DispatchMC(const MemcacheParser::Command& cmd, std::string_view va MCReplyBuilder* mc_builder, facade::ConnectionContext* cntx) { absl::InlinedVector args; char cmd_name[16]; - char ttl[16]; + char ttl[absl::numbers_internal::kFastToBufferSize]; char store_opt[32] = {0}; char ttl_op[] = "EXAT"; diff --git a/src/server/replica.cc b/src/server/replica.cc index f1f109cd7350..0a737878abae 100644 --- a/src/server/replica.cc +++ b/src/server/replica.cc @@ -645,7 +645,7 @@ error_code Replica::ConsumeRedisStream() { } if (!LastResponseArgs().empty()) { - string_view cmd = absl::CHexEscape(ToSV(LastResponseArgs()[0].GetBuf())); + string cmd = absl::CHexEscape(ToSV(LastResponseArgs()[0].GetBuf())); // Valkey and Redis may send MULTI and EXEC as part of their replication commands. // Dragonfly disallows some commands, such as SELECT, inside of MULTI/EXEC, so here we simply diff --git a/src/server/server_family.cc b/src/server/server_family.cc index 96fafc891950..c42abdc58113 100644 --- a/src/server/server_family.cc +++ b/src/server/server_family.cc @@ -1773,8 +1773,9 @@ void ServerFamily::CancelBlockingOnThread(std::function stat } }; - for (auto* listener : listeners_) - listener->TraverseConnectionsOnThread(cb); + for (auto* listener : listeners_) { + listener->TraverseConnectionsOnThread(cb, UINT32_MAX, nullptr); + } } string GetPassword() { diff --git a/src/server/test_utils.cc b/src/server/test_utils.cc index c485246e47f2..a942a8e8c767 100644 --- a/src/server/test_utils.cc +++ b/src/server/test_utils.cc @@ -57,8 +57,8 @@ static vector SplitLines(const std::string& src) { return res; } -TestConnection::TestConnection(Protocol protocol, io::StringSink* sink) - : facade::Connection(protocol, nullptr, nullptr, nullptr), sink_(sink) { +TestConnection::TestConnection(Protocol protocol) + : facade::Connection(protocol, nullptr, nullptr, nullptr) { cc_.reset(new dfly::ConnectionContext(this, {})); cc_->skip_acl_validation = true; SetSocket(ProactorBase::me()->CreateSocket()); @@ -141,7 +141,7 @@ class BaseFamilyTest::TestConnWrapper { }; BaseFamilyTest::TestConnWrapper::TestConnWrapper(Protocol proto) - : dummy_conn_(new TestConnection(proto, &sink_)) { + : dummy_conn_(new TestConnection(proto)) { switch (proto) { case Protocol::REDIS: builder_.reset(new RedisReplyBuilder{&sink_}); diff --git a/src/server/test_utils.h b/src/server/test_utils.h index b0d86f50b9d6..753ba82af245 100644 --- a/src/server/test_utils.h +++ b/src/server/test_utils.h @@ -25,7 +25,7 @@ void TEST_InvalidateLockTagOptions(); class TestConnection : public facade::Connection { public: - TestConnection(Protocol protocol, io::StringSink* sink); + explicit TestConnection(Protocol protocol); std::string RemoteEndpointStr() const override; void SendPubMessageAsync(PubMessage pmsg) final; @@ -44,7 +44,6 @@ class TestConnection : public facade::Connection { std::vector invalidate_messages; private: - io::StringSink* sink_; bool is_privileged_ = false; }; diff --git a/src/server/zset_family.cc b/src/server/zset_family.cc index 80275ba4333a..357a90f7439e 100644 --- a/src/server/zset_family.cc +++ b/src/server/zset_family.cc @@ -1553,7 +1553,7 @@ OpResult ZPopMinMaxInternal(std::string_view key, FilterShards shou } auto cb = [&](Transaction* t, EngineShard* shard) { if (!key_shard.has_value() || *key_shard == shard->shard_id()) { - result = std::move(OpPopCount(range_spec, t->GetOpArgs(shard), key)); + result = OpPopCount(range_spec, t->GetOpArgs(shard), key); } return OpStatus::OK; }; diff --git a/src/server/zset_family.h b/src/server/zset_family.h index c247c98adf89..a2d1bb35d954 100644 --- a/src/server/zset_family.h +++ b/src/server/zset_family.h @@ -19,7 +19,7 @@ namespace dfly { class CommandRegistry; struct CommandContext; class Transaction; -class OpArgs; +struct OpArgs; class ZSetFamily { public: