-
Notifications
You must be signed in to change notification settings - Fork 743
LocalDB: Retry failed GC requests #17386
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
|
🟢 |
6ef1ac7 to
b8cf79f
Compare
|
⚪ DetailsTest 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 |
|
⚪ DetailsTest history | Ya make output | Test bloat
⚪ DetailsTest history | Ya make output | Test bloat | Test bloat
⚪ Test history | Ya make output | Test bloat | 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 |
b8cf79f to
0a14d96
Compare
|
⚪ DetailsTest 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 |
|
⚪ DetailsTest history | Ya make output | Test bloat
⚪ DetailsTest history | Ya make output | Test bloat | Test bloat
⚪ Test history | Ya make output | Test bloat | 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 |
0a14d96 to
4e33302
Compare
4e33302 to
ff2fad2
Compare
|
⚪ DetailsTest 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 |
|
⚪ DetailsTest history | Ya make output | Test bloat
⚪ DetailsTest history | Ya make output | Test bloat | Test bloat
⚪ Test history | Ya make output | Test bloat | 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 |
| GcLogic->OnCollectGarbageResult(ev); | ||
| DataCleanupLogic->OnCollectedGarbage(OwnerCtx()); | ||
|
|
||
| const bool needRetryFailed = DataCleanupLogic->NeedGC(); |
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.
Смущает:
- полезно ретраить в принципе всегда, почему только если есть GC в data cleanup logic?
- этот код про ретраи почему-то выполняется всегда, даже если в ответе нет никаких ошибок, и неочевидно, что на самом деле решения о ретраях принимает вызов
TryScheduleGcRequestRetries
Возможно стоит решение о ретраях принимать в вызове GcLogic->OnCollectGarbageResult, и собственно возвращать в результате на сколько шедулить этот ретрай, если нужно. Тогда вся логика будет внутри gc logic, и не будет такого, что часть этой логики почему-то в таблетке снаружи.
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.
Тут хотел между OnCollectGarbageResult и TryScheduleGcRequestRetries ещё спрашивать у DataCleanupLogic "а точно ли ещё нужнен GC". Но если ретраить всегда, то можно упростить логику. Переделаю, чтоб всегда ретраить.
| if (GcWaitFor == 0) { // all channel's GC completed | ||
| if (CommitedGcBarrier == KnownGcBarrier && TryCounter > 0) { // all GC requests succeeded and we must reset try counter | ||
| TryCounter = 0; | ||
| BackoffTimer.Reset(); |
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.
Какая-то сложная для понимая логика со сравнением барьеров и т.д. Я бы сделал более явно:
- В
OnCollectGarbageFailureинкрементил счётчик ошибок в текущем запросе - В
OnCollectGarbageSuccessтам жеCollectSent.Clear()делать вот это обнуление, если не было ошибок (а их там и не могло быть, т.к. в случае ошибок делаетсяCollectSent.Clear()и мы туда не дойдём) - В
SendCollectGarbageзанулять счётчик ошибок
Тогда в этом методе можно будет просто проверять счётчик ошибок и если они были - то шедулить запрос.
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.
Да, зануление можно действительно перенести в OnCollectGarbageSuccess.
Отдельный счётчик ошибок не стал делать, так как посчитал, что текущей информации достаточно. Но можно сделать и явно, да.
| } | ||
|
|
||
| void TExecutorGCLogic::TChannelInfo::RetryGcRequests(const TTabletStorageInfo *tabletStorageInfo, ui32 channel, ui32 generation, const TActorContext& ctx) { | ||
| RetryIsScheduled = false; |
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.
Мне кажется здесь нужно проверять, что этот флаг установлен (и ничего не делать, если не установлен). Плюс сбрасывать этот флаг, если например SendCollectGarbage вызвался до срабатывания таймера (мы уже новый запрос отправили, если нужно, и ретраить после этого всё-равно нужно новый запрос, а не старый).
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.
Ну тут логика, что при очередном SendCollectGarbage и ошибке происходит не перепланирование ретрая (как ты по сути предлагаешь), а просто повторные ретраи игнорируются, пока не обработался первый ретрай. В этом варианте создаётся меньше событий EvRetryGcRequest (так как, условно, более старое событие переиспользуется для более новых ошибок, которые возникли к моменту обработки), но ретраи могут происходят чаще (так как не зависят от конкуретных нормальных GC)
|
⚪ DetailsTest history | Ya make output | Test bloat
⚪ DetailsTest history | Ya make output | Test bloat | Test bloat
⚪ Test history | Ya make output | Test bloat | 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 |
|
⚪ DetailsTest 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 |
983e2ec to
745cc6f
Compare
|
⚪ DetailsTest 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 |
|
⚪ DetailsTest history | Ya make output | Test bloat
⚪ DetailsTest history | Ya make output | Test bloat | Test bloat
⚪ Test history | Ya make output | Test bloat | 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
...
Changelog category
Description for reviewers
...