Skip to content

Commit 607a6d6

Browse files
committed
Replace topic to raw in pq_v1 and topics
1 parent 18174b0 commit 607a6d6

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

ydb/services/persqueue_v1/actors/read_session_actor.cpp

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1724,12 +1724,22 @@ template <typename TServerMessage>
17241724
i64 TFormedReadResponse<TServerMessage>::ApplyResponse(TServerMessage&& resp) {
17251725
constexpr bool UseMigrationProtocol = std::is_same_v<TServerMessage, PersQueue::V1::MigrationStreamingReadServerMessage>;
17261726

1727+
auto* partition_data = UseMigrationProtocol
1728+
? resp.mutable_data_batch()->mutable_partition_data(0)
1729+
: resp.mutable_read_response()->mutable_partition_data(0);
1730+
1731+
Y_ABORT_UNLESS(partition_data != nullptr && partition_data->batches_size() > 0);
1732+
1733+
for (auto& batch : *partition_data->mutable_batches()) {
1734+
if (batch.codec() == Ydb::PersQueue::V1::CODEC_UNSPECIFIED) {
1735+
batch.set_codec(Ydb::PersQueue::V1::CODEC_RAW);
1736+
}
1737+
}
1738+
17271739
if constexpr (UseMigrationProtocol) {
1728-
Y_ABORT_UNLESS(resp.data_batch().partition_data_size() == 1);
1729-
Response.mutable_data_batch()->add_partition_data()->Swap(resp.mutable_data_batch()->mutable_partition_data(0));
1740+
Response.mutable_data_batch()->add_partition_data()->Swap(partition_data);
17301741
} else {
1731-
Y_ABORT_UNLESS(resp.read_response().partition_data_size() == 1);
1732-
Response.mutable_read_response()->add_partition_data()->Swap(resp.mutable_read_response()->mutable_partition_data(0));
1742+
Response.mutable_read_response()->add_partition_data()->Swap(partition_data);
17331743
}
17341744

17351745
Response.set_status(Ydb::StatusIds::SUCCESS);
@@ -1739,6 +1749,7 @@ i64 TFormedReadResponse<TServerMessage>::ApplyResponse(TServerMessage&& resp) {
17391749
return ByteSize - prev;
17401750
}
17411751

1752+
17421753
template <typename TServerMessage>
17431754
i64 TFormedReadResponse<TServerMessage>::ApplyDirectReadResponse(TEvPQProxy::TEvDirectReadResponse::TPtr& ev) {
17441755

0 commit comments

Comments
 (0)