-
Notifications
You must be signed in to change notification settings - Fork 23
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
fix delete session #2591
base: main
Are you sure you want to change the base?
fix delete session #2591
Conversation
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.
что-то ничего непонятно, нужно описание
@@ -12,7 +12,7 @@ namespace { | |||
|
|||
constexpr size_t MaxSubSessions = 2; | |||
|
|||
} | |||
} // namespace |
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.
отступ перед // namespace у нас обычно другой
return owner; | ||
} | ||
|
||
// update sequence number fir ro and rw clients |
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.
fir -> for
SubSessions, | ||
[&] (const auto& subsession) { | ||
return subsession.Owner == owner; | ||
}); | ||
if (subsession == SubSessions.end()) { | ||
return true; | ||
return MaxRoSeqNo != 0 || MaxRwSeqNo != 0; |
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.
почему?
return false; | ||
} | ||
// check if writer is deleted | ||
bool writerAlive = subsession->SeqNo < MaxRwSeqNo; |
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.
а почему так проверяем? мы тут разве считаем, что subsession - это точно writer?
|
||
return true; | ||
return SubSessions.size() || writerAlive || migrationInProgress; |
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.
разве из того факта, что writer у нас alive, не следует автоматически, что SubSessions непуст? то есть разве условие SubSessions.size() || writerAlive не эквивалентно просто условию SubSessions.size()?
} | ||
|
||
SubSessions.erase(subsession); | ||
// check if writer is deleted |
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.
копипаста какая-то
void TSubSessions::UpdateSeqNoAfterDelete(ui64 seqNo) | ||
{ | ||
if (seqNo == MaxRoSeqNo) { | ||
MaxRoSeqNo = 0; |
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.
а другие сессии нам тут разве неинтересны? почему Max*SeqNo сбрасываются в 0, а не в max по остальным subsessions?
ui32 DeleteSubSession(ui64 sessionSeqNo); | ||
bool DeleteSubSession(const NActors::TActorId& owner); | ||
bool DeleteSubSession(ui64 sessionSeqNo); | ||
void UpdateSeqNoAfterDelete(ui64 seqNo); |
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.
это разве должно быть публичным методом?
ui32 nodeIdx = env.CreateNode("nfs"); | ||
ui64 tabletId = env.BootIndexTablet(nodeIdx); | ||
|
||
{ |
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.
без комментариев непонятно, что зачем делается - почему именно такой порядок событий
#2590
The problem was that after tablet restart it does not have connected client records but only sequence numbers for rw and ro clients. But it turned out that instead of reconnecting with CreateSession, client can send just DestroySession. And this situation was not handled properly.