-
Notifications
You must be signed in to change notification settings - Fork 615
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
Preload followers data #5835
Preload followers data #5835
Conversation
KeysEnv->Save(cookie, std::move(loaded)); | ||
if (Stage == EStage::PartView || Stage == EStage::Slice || Stage == EStage::PreloadData) { | ||
for (auto& loaded : loadedPages) { | ||
LoaderEnv->Save(cookie, std::move(loaded)); |
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.
Сделал чтобы все страницы шли через кэширующий Env, а то предзагрузка индекса который не пинится может бесконечно зациклиться
if (BTreeGroupIndexes) { | ||
// Note: preload root nodes only because we don't want to have multiple restarts here | ||
for (const auto& meta : BTreeGroupIndexes) { | ||
if (meta.LevelCount) getPage(meta.PageId); |
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.
Вообще можно и страницу с данными тут грузить, если она одна, но не знаю насколько интересно
@@ -361,6 +361,7 @@ void TDataShard::OnActivateExecutor(const TActorContext& ctx) { | |||
SyncConfig(); | |||
State = TShardState::Readonly; | |||
FollowerState = { }; | |||
Executor()->SetPreloadTablesData({Schema::Sys::TableId, Schema::UserTables::TableId, Schema::Snapshots::TableId}); |
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.
Если будут варианты покрасивше чем HashSet полем в executor - послушаю
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.
Как вариант можно было бы сделать callback'ом у ITablet, типа нужно ли грузить данные таблицы X. Можно было бы также вызывать во время начальной загрузки, т.к. сейчас это похоже используются только в part switch'ах, и OnActivateExecutor в принципе вызывается только когда уже таблетка готова к работе.
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.
Можно было бы также вызывать во время начальной загрузки
А вот тут по комментарию мне показалось, что в момент загрузки у нас может и не быть системных таблиц на фолловере вовсе?
ydb/ydb/core/tx/datashard/datashard__init.cpp
Line 685 in 5aae686
// Check that TxInit from leader has been already replicated to the follower |
Я правда не смог понять, что за TxInit тут имели ввиду.
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.
На фолловерах TxInit (транзакция) не вызывается совсем. Этот комментарий относится к тому, что мы здесь проверяем проинициализировался ли шард вообще - конкретно накатил ли он схему. Потому что фолловер ничего проинициализировать не может, под ним асинхронно схема и данные постоянно меняются.
⚪ |
d9887f7
to
a9c1cd8
Compare
⚪
🟢
*please be aware that the difference is based on comparing your commit and the last completed build from the post-commit, check comparation |
⚪
🟢
*please be aware that the difference is based on comparing your commit and the last completed build from the post-commit, check comparation |
⚪
🟢
*please be aware that the difference is based on comparing your commit and the last completed build from the post-commit, check comparation |
⚪
🟢
*please be aware that the difference is based on comparing your commit and the last completed build from the post-commit, check comparation |
⚪
🟢
*please be aware that the difference is based on comparing your commit and the last completed build from the post-commit, check comparation |
⚪
🟢
*please be aware that the difference is based on comparing your commit and the last completed build from the post-commit, check comparation |
Changelog entry
...
Changelog category
Additional information
Resolves #4744
Latencies become a bit better
https://gist.github.com/kunga/12af041b01499117cb40042ecaf7e1c8
https://nda.ya.ru/t/6HpGDKpA76ZF8r
Before:
After: