Skip to content

Commit a8ee862

Browse files
Decode source id in topic data handler (#17554)
1 parent 0b821c5 commit a8ee862

File tree

2 files changed

+17
-13
lines changed

2 files changed

+17
-13
lines changed

ydb/core/viewer/tests/canondata/result.json

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -801,7 +801,7 @@
801801
"Message": "Y29tcHJlc3NlZC1tZXNzYWdlLTA=",
802802
"Offset": 11,
803803
"OriginalSize": 20,
804-
"ProducerId": "text",
804+
"ProducerId": "not-zero-number-text",
805805
"SeqNo": 12,
806806
"StorageSize": 38,
807807
"TimestampDiff": "not-zero-number",
@@ -813,7 +813,7 @@
813813
"Message": "Y29tcHJlc3NlZC1tZXNzYWdlLTE=",
814814
"Offset": 12,
815815
"OriginalSize": 20,
816-
"ProducerId": "text",
816+
"ProducerId": "not-zero-number-text",
817817
"SeqNo": 13,
818818
"StorageSize": 38,
819819
"TimestampDiff": "not-zero-number",
@@ -825,7 +825,7 @@
825825
"Message": "Y29tcHJlc3NlZC1tZXNzYWdlLTI=",
826826
"Offset": 13,
827827
"OriginalSize": 20,
828-
"ProducerId": "text",
828+
"ProducerId": "not-zero-number-text",
829829
"SeqNo": 14,
830830
"StorageSize": 38,
831831
"TimestampDiff": "not-zero-number",
@@ -837,7 +837,7 @@
837837
"Message": "Y29tcHJlc3NlZC1tZXNzYWdlLTM=",
838838
"Offset": 14,
839839
"OriginalSize": 20,
840-
"ProducerId": "text",
840+
"ProducerId": "not-zero-number-text",
841841
"SeqNo": 15,
842842
"StorageSize": 38,
843843
"TimestampDiff": "not-zero-number",
@@ -849,7 +849,7 @@
849849
"Message": "Y29tcHJlc3NlZC1tZXNzYWdlLTQ=",
850850
"Offset": 15,
851851
"OriginalSize": 20,
852-
"ProducerId": "text",
852+
"ProducerId": "not-zero-number-text",
853853
"SeqNo": 16,
854854
"StorageSize": 38,
855855
"TimestampDiff": "not-zero-number",
@@ -878,7 +878,7 @@
878878
],
879879
"Offset": 10,
880880
"OriginalSize": 17,
881-
"ProducerId": "text",
881+
"ProducerId": "not-zero-number-text",
882882
"SeqNo": 11,
883883
"StorageSize": 37,
884884
"TimestampDiff": "not-zero-number",
@@ -897,7 +897,7 @@
897897
"Message": "Y29tcHJlc3NlZC1tZXNzYWdlLTk=",
898898
"Offset": 20,
899899
"OriginalSize": 20,
900-
"ProducerId": "text",
900+
"ProducerId": "not-zero-number-text",
901901
"SeqNo": 21,
902902
"StorageSize": 38,
903903
"TimestampDiff": "not-zero-number",
@@ -916,7 +916,7 @@
916916
"Message": "bWVzc2FnZS0w",
917917
"Offset": 0,
918918
"OriginalSize": 9,
919-
"ProducerId": "text",
919+
"ProducerId": "not-zero-number-text",
920920
"SeqNo": 1,
921921
"StorageSize": 9,
922922
"TimestampDiff": "not-zero-number",
@@ -928,7 +928,7 @@
928928
"Message": "bWVzc2FnZS0x",
929929
"Offset": 1,
930930
"OriginalSize": 9,
931-
"ProducerId": "text",
931+
"ProducerId": "not-zero-number-text",
932932
"SeqNo": 2,
933933
"StorageSize": 9,
934934
"TimestampDiff": "not-zero-number",
@@ -940,7 +940,7 @@
940940
"Message": "bWVzc2FnZS0y",
941941
"Offset": 2,
942942
"OriginalSize": 9,
943-
"ProducerId": "text",
943+
"ProducerId": "not-zero-number-text",
944944
"SeqNo": 3,
945945
"StorageSize": 9,
946946
"TimestampDiff": "not-zero-number",
@@ -952,7 +952,7 @@
952952
"Message": "bWVzc2FnZS0z",
953953
"Offset": 3,
954954
"OriginalSize": 9,
955-
"ProducerId": "text",
955+
"ProducerId": "not-zero-number-text",
956956
"SeqNo": 4,
957957
"StorageSize": 9,
958958
"TimestampDiff": "not-zero-number",
@@ -964,7 +964,7 @@
964964
"Message": "bWVzc2FnZS00",
965965
"Offset": 4,
966966
"OriginalSize": 9,
967-
"ProducerId": "text",
967+
"ProducerId": "not-zero-number-text",
968968
"SeqNo": 5,
969969
"StorageSize": 9,
970970
"TimestampDiff": "not-zero-number",

ydb/core/viewer/viewer_topic_data.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,11 @@ void TTopicData::FillProtoResponse(ui64 maxSingleMessageSize, ui64 maxTotalSize)
181181
setData(*messageProto, std::move(*dataChunk.MutableData()));
182182
}
183183
messageProto->SetCodec(dataChunk.GetCodec());
184-
messageProto->SetProducerId(r.GetSourceId());
184+
TString decodedSrcId;
185+
if (!r.GetSourceId().empty()) {
186+
decodedSrcId = NPQ::NSourceIdEncoding::Decode(r.GetSourceId());
187+
}
188+
messageProto->SetProducerId(decodedSrcId);
185189
messageProto->SetSeqNo(r.GetSeqNo());
186190

187191
if (dataChunk.MessageMetaSize() > 0) {

0 commit comments

Comments
 (0)