-
Notifications
You must be signed in to change notification settings - Fork 638
Messages are written to the partition in two stages #18118
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
base: main
Are you sure you want to change the base?
Conversation
🟢 |
b9c6e6e
to
bbc02d5
Compare
⚪ |
⚪ |
ydb/core/persqueue/partition.cpp
Outdated
@@ -392,12 +395,28 @@ void TPartition::AddMetaKey(TEvKeyValue::TEvRequest* request) { | |||
write->SetStorageChannel(NKikimrClient::TKeyValueRequest::INLINE); | |||
} | |||
|
|||
//bool TPartition::CleanUpFastWrite(TEvKeyValue::TEvRequest* request, const TActorContext& ctx) |
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.
забыл удалить?
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.
Удалил закоментированный код
f8bc181
ydb/core/persqueue/partition.cpp
Outdated
@@ -434,9 +453,9 @@ bool TPartition::CleanUpBlobs(TEvKeyValue::TEvRequest *request, const TActorCont | |||
break; | |||
} | |||
|
|||
auto& firstKey = BlobEncoder.DataKeysBody.front(); | |||
auto& firstKey = CompactionBlobEncoder.DataKeysBody.front(); |
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.
auto& firstKey = CompactionBlobEncoder.DataKeysBody.front(); | |
const auto& firstKey = CompactionBlobEncoder.DataKeysBody.front(); |
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/core/persqueue/partition.cpp
Outdated
@@ -937,15 +956,41 @@ void TPartition::LogAndCollectError(NKikimrServices::EServiceKikimr service, con | |||
LogAndCollectError(error, ctx); | |||
} | |||
|
|||
const TPartitionBlobEncoder& TPartition::GetPartitionZone(ui64 offset) const |
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.
const TPartitionBlobEncoder& TPartition::GetPartitionZone(ui64 offset) const | |
const TPartitionBlobEncoder& TPartition::GetPartitionEncoder(ui64 offset) const |
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/core/persqueue/partition.cpp
Outdated
@@ -2140,7 +2205,8 @@ void TPartition::RunPersist() { | |||
WriteInfosApplied.clear(); | |||
//Done with counters. | |||
|
|||
DumpKeyValueRequest(PersistRequest->Record); | |||
//// иногда во время отладки хочется посмотреть что записывается на диск |
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.
//// иногда во время отладки хочется посмотреть что записывается на диск | |
// for debugging purposes |
Y_ABORT_UNLESS(Head.PackedSize == 0, | ||
"Head.PackedSize=%" PRIu32, Head.PackedSize); | ||
|
||
// если это первая запись |
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.
надо поперводить все на англицкий
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.
Перевёл
bb4a452
HeadKeys.clear(); | ||
|
||
// мы только что записали, в теле должно что-то быть | ||
Y_ABORT_UNLESS(!DataKeysBody.empty()); |
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.
А могли выше HeadKeys быть пустыми?
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.
Здесь Head.PackedSize != 0 и в голове что-то есть.
auto keys = std::move(dataKeysBody); | ||
dataKeysBody.clear(); | ||
|
||
auto& cz = Partition()->CompactionBlobEncoder; // Compaction zone |
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.
А может дать полные названия? а то сложно читается :)
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.
Переменные активно используются в этой функции. Мне было неудобно читать с длинными именами. Поэтому сократил.
@@ -452,6 +589,24 @@ TReadAnswer TReadInfo::FormAnswer( | |||
Y_ABORT_UNLESS(blobs.size() == Blobs.size()); | |||
response->Check(); | |||
bool needStop = false; | |||
#if 1 |
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.
а это зачем?
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 GetNewFastWriteKeyImpl(headCleared, headSize); | ||
} | ||
|
||
//std::pair<TKey, ui32> TPartition::GetNewWriteKeyImpl(bool headCleared, bool needCompaction, ui32 headSize) |
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.
и тут какой-то непонятный коммент :)
@@ -2057,6 +2113,14 @@ void TPartition::ProcessCommitQueue() { | |||
} | |||
} | |||
|
|||
ui64 TPartition::NextReadCookie() | |||
{ | |||
if (Cookie == Max<ui64>()) { |
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.
Смысл метода не понимаю.
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.
Пропускает зарезервированные значения cookie
⚪ Test history | Ya make output | Test bloat
⚪ Test 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 |
⚪ Test history | Ya make output | Test bloat
⚪ Test 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
The logic of writing messages in the partition has changed. In the first iteration, the message is written as is and a response is sent to the user. In the second iteration, the written messages are combined into large blobs.
Changelog category
Description for reviewers
...