-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
[core]Make GCS InternalKV workload configurable to the Policy. #47736
base: master
Are you sure you want to change the base?
Changes from all commits
bcf81c8
c84fd80
a021521
5d8eaee
36fc808
a87c39d
7cd7705
bbf02cd
99f7ba9
a1ab6c6
cf3f343
6d006e9
110ae3e
3d5e7f0
3461330
4ade4af
a607528
698cbe9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -69,15 +69,17 @@ GcsServer::GcsServer(const ray::gcs::GcsServerConfig &config, | |
periodical_runner_(io_context_provider_.GetDefaultIOContext()), | ||
is_started_(false), | ||
is_stopped_(false) { | ||
// Init GCS table storage. | ||
// Init GCS table storage. Note this is on the default io context, not the one with | ||
// GcsInternalKVManager, to avoid congestion on the latter. | ||
Comment on lines
+72
to
+73
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. what does this mean? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Meaning gcs_table_storage_ should always go with GetDefaultIOContext, not with There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
What does this mean? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If gcs_table_storage_ operations go with |
||
RAY_LOG(INFO) << "GCS storage type is " << storage_type_; | ||
switch (storage_type_) { | ||
case StorageType::IN_MEMORY: | ||
gcs_table_storage_ = std::make_shared<InMemoryGcsTableStorage>( | ||
io_context_provider_.GetDefaultIOContext()); | ||
break; | ||
case StorageType::REDIS_PERSIST: | ||
gcs_table_storage_ = std::make_shared<gcs::RedisGcsTableStorage>(GetOrConnectRedis()); | ||
gcs_table_storage_ = std::make_shared<gcs::RedisGcsTableStorage>( | ||
GetOrConnectRedis(io_context_provider_.GetDefaultIOContext())); | ||
break; | ||
default: | ||
RAY_LOG(FATAL) << "Unexpected storage type: " << storage_type_; | ||
|
@@ -557,13 +559,13 @@ void GcsServer::InitKVManager() { | |
std::unique_ptr<InternalKVInterface> instance; | ||
switch (storage_type_) { | ||
case (StorageType::REDIS_PERSIST): | ||
instance = std::make_unique<StoreClientInternalKV>( | ||
std::make_unique<RedisStoreClient>(GetOrConnectRedis())); | ||
instance = std::make_unique<StoreClientInternalKV>(std::make_unique<RedisStoreClient>( | ||
GetOrConnectRedis(io_context_provider_.GetIOContext<GcsInternalKVManager>()))); | ||
break; | ||
case (StorageType::IN_MEMORY): | ||
instance = std::make_unique<StoreClientInternalKV>( | ||
std::make_unique<ObservableStoreClient>(std::make_unique<InMemoryStoreClient>( | ||
io_context_provider_.GetDefaultIOContext()))); | ||
io_context_provider_.GetIOContext<GcsInternalKVManager>()))); | ||
break; | ||
default: | ||
RAY_LOG(FATAL) << "Unexpected storage type! " << storage_type_; | ||
|
@@ -576,7 +578,7 @@ void GcsServer::InitKVManager() { | |
void GcsServer::InitKVService() { | ||
RAY_CHECK(kv_manager_); | ||
kv_service_ = std::make_unique<rpc::InternalKVGrpcService>( | ||
io_context_provider_.GetDefaultIOContext(), *kv_manager_); | ||
io_context_provider_.GetIOContext<GcsInternalKVManager>(), *kv_manager_); | ||
// Register service. | ||
rpc_server_.RegisterService(*kv_service_, false /* token_auth */); | ||
} | ||
|
@@ -819,7 +821,8 @@ std::string GcsServer::GetDebugState() const { | |
return stream.str(); | ||
} | ||
|
||
std::shared_ptr<RedisClient> GcsServer::GetOrConnectRedis() { | ||
std::shared_ptr<RedisClient> GcsServer::GetOrConnectRedis( | ||
instrumented_io_context &io_service) { | ||
if (redis_client_ == nullptr) { | ||
redis_client_ = std::make_shared<RedisClient>(GetRedisClientOptions()); | ||
auto status = redis_client_->Connect(io_context_provider_.GetDefaultIOContext()); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// Copyright 2024 The Ray Authors. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
#pragma once | ||
|
||
namespace ray { | ||
|
||
template <typename T> | ||
constexpr bool AlwaysFalse = false; | ||
|
||
template <typename T> | ||
constexpr bool AlwaysTrue = true; | ||
|
||
template <int N> | ||
constexpr bool AlwaysFalseValue = false; | ||
|
||
template <int N> | ||
constexpr bool AlwaysTrueValue = true; | ||
|
||
} // namespace ray |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why removing move?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
because that fn move did not work, because fn is a const& and move is no-op.