-
Notifications
You must be signed in to change notification settings - Fork 411
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
*: Make tiflash compatible with the cse branch #9765
Open
JaySon-Huang
wants to merge
12
commits into
pingcap:master
Choose a base branch
from
JaySon-Huang:align_with_cse
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
5632a14
Align the diff of short value in lock cf under cse
JaySon-Huang feda366
Add ut
JaySon-Huang 254e2fb
Add blocklist feature
JaySon-Huang 7c46643
fix blacklist-file args to proxy
JaySon-Huang 2db71b8
Add http api for cse
JaySon-Huang 4195065
mtls: metrics server allows anonymous pullers
JaySon-Huang 4fff97b
Enlarge the max parall prehandle size
JaySon-Huang 78104f1
txn-file: support txn file feature with cse
JaySon-Huang 92b36b1
Fix parallel prehandle limit
JaySon-Huang e019cfa
Fix lint
JaySon-Huang 236d14f
Fix compile error
JaySon-Huang 9d18047
Remove unstable settings
JaySon-Huang File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -324,6 +324,10 @@ struct TiFlashProxyConfig | |||||
args_map["engine-label"] = getProxyLabelByDisaggregatedMode(disaggregated_mode); | ||||||
if (disaggregated_mode != DisaggregatedMode::Compute && has_s3_config) | ||||||
args_map["engine-role-label"] = DISAGGREGATED_MODE_WRITE_ENGINE_ROLE; | ||||||
#if SERVERLESS_PROXY == 1 | ||||||
if (config.has("blacklist_file")) | ||||||
args_map["blacklist-ile"] = config.getString("blacklist_file"); | ||||||
#endif | ||||||
|
||||||
for (auto && [k, v] : args_map) | ||||||
val_map.emplace("--" + k, std::move(v)); | ||||||
|
@@ -961,6 +965,74 @@ void syncSchemaWithTiDB( | |||||
global_context->initializeSchemaSyncService(); | ||||||
} | ||||||
|
||||||
void loadBlockList( | ||||||
[[maybe_unused]] const Poco::Util::LayeredConfiguration & config, | ||||||
Context & global_context, | ||||||
[[maybe_unused]] const LoggerPtr & log) | ||||||
{ | ||||||
#if SERVERLESS_PROXY != 1 | ||||||
// We do not support blocking store by id in OP mode currently. | ||||||
global_context.initializeStoreIdBlockList(""); | ||||||
#else | ||||||
global_context.initializeStoreIdBlockList(global_context.getSettingsRef().disagg_blocklist_wn_store_id); | ||||||
|
||||||
/// Load keyspace blacklist json file | ||||||
LOG_INFO(log, "Loading blacklist file."); | ||||||
auto blacklist_file_path = config.getString("blacklist_file", ""); | ||||||
if (blacklist_file_path.length() == 0) | ||||||
{ | ||||||
LOG_INFO(log, "blacklist file not enabled, ignore it."); | ||||||
} | ||||||
else | ||||||
{ | ||||||
auto blacklist_file = Poco::File(blacklist_file_path); | ||||||
if (blacklist_file.exists() && blacklist_file.isFile() && blacklist_file.canRead()) | ||||||
{ | ||||||
// Read the json file | ||||||
std::ifstream ifs(blacklist_file_path); | ||||||
std::string json_content((std::istreambuf_iterator<char>(ifs)), std::istreambuf_iterator<char>()); | ||||||
Poco::JSON::Parser parser; | ||||||
Poco::Dynamic::Var json_var = parser.parse(json_content); | ||||||
const auto & json_obj = json_var.extract<Poco::JSON::Object::Ptr>(); | ||||||
|
||||||
// load keyspace list | ||||||
auto keyspace_arr = json_obj->getArray("keyspace_ids"); | ||||||
if (!keyspace_arr.isNull()) | ||||||
{ | ||||||
std::unordered_set<KeyspaceID> keyspace_blocklist; | ||||||
for (size_t i = 0; i < keyspace_arr->size(); i++) | ||||||
{ | ||||||
keyspace_blocklist.emplace(keyspace_arr->getElement<KeyspaceID>(i)); | ||||||
} | ||||||
global_context.initKeyspaceBlocklist(keyspace_blocklist); | ||||||
} | ||||||
|
||||||
// load region list | ||||||
auto region_arr = json_obj->getArray("region_ids"); | ||||||
if (!region_arr.isNull()) | ||||||
{ | ||||||
std::unordered_set<RegionID> region_blocklist; | ||||||
for (size_t i = 0; i < region_arr->size(); i++) | ||||||
{ | ||||||
region_blocklist.emplace(region_arr->getElement<RegionID>(i)); | ||||||
} | ||||||
global_context.initRegionBlocklist(region_blocklist); | ||||||
} | ||||||
|
||||||
LOG_INFO( | ||||||
log, | ||||||
"Load blacklist file done, total {} keyspaces and {} regions in blacklist.", | ||||||
keyspace_arr.isNull() ? 0 : keyspace_arr->size(), | ||||||
region_arr.isNull() ? 0 : region_arr->size()); | ||||||
} | ||||||
else | ||||||
{ | ||||||
LOG_INFO(log, "blacklist file not exists or non-readble, ignore it."); | ||||||
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.
Suggested change
|
||||||
} | ||||||
} | ||||||
#endif | ||||||
} | ||||||
|
||||||
int Server::main(const std::vector<std::string> & /*args*/) | ||||||
{ | ||||||
setThreadName("TiFlashMain"); | ||||||
|
@@ -1547,8 +1619,7 @@ int Server::main(const std::vector<std::string> & /*args*/) | |||||
global_context->setFormatSchemaPath(format_schema_path.path() + "/"); | ||||||
format_schema_path.createDirectories(); | ||||||
|
||||||
// We do not support blocking store by id in OP mode currently. | ||||||
global_context->initializeStoreIdBlockList(""); | ||||||
loadBlockList(config(), *global_context, log); | ||||||
|
||||||
LOG_INFO(log, "Loading metadata."); | ||||||
loadMetadataSystem(*global_context); // Load "system" database. Its engine keeps as Ordinary. | ||||||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.