-
Notifications
You must be signed in to change notification settings - Fork 737
Fix publishing base statistics that was not properly persisted #24485
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
Conversation
|
🟢 |
|
⚪ Test history | Ya make output | Test bloat
🟡
*please be aware that the difference is based on comparing your commit and the last completed build from the post-commit, check comparation |
17bf9ed to
53b4717
Compare
|
⚪ Test history | Ya make output | Test bloat
⚪ Test history | Ya make output | Test bloat | Test bloat
🟢
*please be aware that the difference is based on comparing your commit and the last completed build from the post-commit, check comparation |
|
⚪ Test history | Ya make output | Test bloat
🟢
*please be aware that the difference is based on comparing your commit and the last completed build from the post-commit, check comparation |
|
|
||
| std::unordered_map<TSSId, TString> BaseStatistics; // schemeshard id -> serialized stats for all paths | ||
| // Schemeshard id -> latest update from a tx that has not yet completed. | ||
| std::unordered_map<TSSId, std::shared_ptr<TString>> BaseStatisticsUpdateInflight; |
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.
Если честно мне не нравится этот временный unordered_map и то что в нём временный shared_ptr, хотя я и понимаю зачем ты его сделал. Можно ли сделать одну единую BaseStatistics? Например вида TSSId -> TSchemeShardStats, и там уже что-нибудь вроде:
struct TSchemeShardStats {
std::shared_ptr<TString> Committed;
std::shared_ptr<TString> Latest;
};Это по идее упростит работу, искать schemeshard нужно будет только в одной хеш-таблице: в Execute транзакций смотрим и обновляем Latest, в Complete присваиваем в Committed, за пределами транзакций смотрим только на Committed (но учитываем, что он может быть nullptr даже если по SSId структура есть). На загрузке из локальной базы присваиваем и в Committed и в Latest. Или так придётся слишком много переделывать?
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.
Да, можно так сделать, даже меньше кода получается
53b4717 to
8b9d96f
Compare
|
⚪ Test history | Ya make output | Test bloat
🟢
*please be aware that the difference is based on comparing your commit and the last completed build from the post-commit, check comparation |
|
⚪ Test history | Ya make output | Test bloat
⚪ Test history | Ya make output | Test bloat | Test bloat
🟢
*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
Fix a bug that could in rare cases lead to base statistics reported to the optimizer to go backwards in time or even to zero values.
Changelog category
Description for reviewers
Don't publish base statistics updates from SchemeShard in StatisticsAggregator before the local tx is committed.