@@ -1720,25 +1720,36 @@ void TReadSessionActor<UseMigrationProtocol>::Handle(TEvPQProxy::TEvRead::TPtr&
1720
1720
ProcessReads (ctx);
1721
1721
}
1722
1722
1723
+
1723
1724
template <typename TServerMessage>
1724
1725
i64 TFormedReadResponse<TServerMessage>::ApplyResponse (TServerMessage&& resp) {
1725
1726
constexpr bool UseMigrationProtocol = std::is_same_v<TServerMessage, PersQueue::V1::MigrationStreamingReadServerMessage>;
1726
1727
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);
1728
+ if constexpr (UseMigrationProtocol) {
1729
+ auto * partition_data = resp.mutable_data_batch ()->mutable_partition_data (0 );
1730
+ Y_ABORT_UNLESS (partition_data != nullptr && partition_data->batches_size () > 0 );
1731
+
1732
+ // Проходим по всем батчам и устанавливаем codec в 0, если он равен -1
1733
+ for (auto & batch : *partition_data->mutable_batches ()) {
1734
+ for (auto & message_data : *batch.mutable_message_data ()) {
1735
+ if (message_data.codec () == Ydb::PersQueue::V1::CODEC_UNSPECIFIED) {
1736
+ message_data.set_codec (Ydb::PersQueue::V1::CODEC_RAW);
1737
+ }
1738
+ }
1736
1739
}
1737
- }
1738
1740
1739
- if constexpr (UseMigrationProtocol) {
1740
1741
Response.mutable_data_batch ()->add_partition_data ()->Swap (partition_data);
1741
1742
} else {
1743
+ auto * partition_data = resp.mutable_read_response ()->mutable_partition_data (0 );
1744
+ Y_ABORT_UNLESS (partition_data != nullptr && partition_data->batches_size () > 0 );
1745
+
1746
+ // Проходим по всем батчам и устанавливаем codec в 0, если он равен -1
1747
+ for (auto & batch : *partition_data->mutable_batches ()) {
1748
+ if (batch.codec () == Ydb::Topic::CODEC_UNSPECIFIED) {
1749
+ batch.set_codec (Ydb::Topic::CODEC_RAW);
1750
+ }
1751
+ }
1752
+
1742
1753
Response.mutable_read_response ()->add_partition_data ()->Swap (partition_data);
1743
1754
}
1744
1755
@@ -1750,6 +1761,7 @@ i64 TFormedReadResponse<TServerMessage>::ApplyResponse(TServerMessage&& resp) {
1750
1761
}
1751
1762
1752
1763
1764
+
1753
1765
template <typename TServerMessage>
1754
1766
i64 TFormedReadResponse<TServerMessage>::ApplyDirectReadResponse (TEvPQProxy::TEvDirectReadResponse::TPtr& ev) {
1755
1767
0 commit comments