Skip to content
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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

Conversation

yegorskii
Copy link
Collaborator

@yegorskii yegorskii commented Nov 28, 2024

#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.

@yegorskii yegorskii added large-tests Launch large tests for PR filestore Add this label to run only cloud/filestore build and tests on PR labels Nov 28, 2024
Copy link
Contributor

Note

This is an automated comment that will be appended during run.

🟢 linux-x86_64-relwithdebinfo: all tests PASSED for commit b43b2b4.

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
1965 1965 0 0 0 0

Copy link
Collaborator

@qkrorlqr qkrorlqr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

что-то ничего непонятно, нужно описание

Copy link
Contributor

Note

This is an automated comment that will be appended during run.

🟢 linux-x86_64-relwithdebinfo: all tests PASSED for commit a774f3d.

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
1965 1965 0 0 0 0

Copy link
Contributor

Note

This is an automated comment that will be appended during run.

🟢 linux-x86_64-relwithdebinfo: all tests PASSED for commit e845983.

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
1965 1965 0 0 0 0

@@ -12,7 +12,7 @@ namespace {

constexpr size_t MaxSubSessions = 2;

}
} // namespace
Copy link
Collaborator

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
Copy link
Collaborator

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;
Copy link
Collaborator

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;
Copy link
Collaborator

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;
Copy link
Collaborator

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
Copy link
Collaborator

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;
Copy link
Collaborator

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);
Copy link
Collaborator

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);

{
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

без комментариев непонятно, что зачем делается - почему именно такой порядок событий

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
filestore Add this label to run only cloud/filestore build and tests on PR large-tests Launch large tests for PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants