aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFloatingCrowbar <komels@ydb.tech>2025-04-24 12:37:25 +0300
committerGitHub <noreply@github.com>2025-04-24 12:37:25 +0300
commita8ee862526776543f88be3976c41bd914de2b281 (patch)
tree147b7b49211e498b30d27cfd31b4ff7f53ed18db
parent0b821c5a606d88995647de7c17de360498d2bd98 (diff)
downloadydb-a8ee862526776543f88be3976c41bd914de2b281.tar.gz
Decode source id in topic data handler (#17554)
-rw-r--r--ydb/core/viewer/tests/canondata/result.json24
-rw-r--r--ydb/core/viewer/viewer_topic_data.cpp6
2 files changed, 17 insertions, 13 deletions
diff --git a/ydb/core/viewer/tests/canondata/result.json b/ydb/core/viewer/tests/canondata/result.json
index 060c3e186c8..93e33dea005 100644
--- a/ydb/core/viewer/tests/canondata/result.json
+++ b/ydb/core/viewer/tests/canondata/result.json
@@ -801,7 +801,7 @@
"Message": "Y29tcHJlc3NlZC1tZXNzYWdlLTA=",
"Offset": 11,
"OriginalSize": 20,
- "ProducerId": "text",
+ "ProducerId": "not-zero-number-text",
"SeqNo": 12,
"StorageSize": 38,
"TimestampDiff": "not-zero-number",
@@ -813,7 +813,7 @@
"Message": "Y29tcHJlc3NlZC1tZXNzYWdlLTE=",
"Offset": 12,
"OriginalSize": 20,
- "ProducerId": "text",
+ "ProducerId": "not-zero-number-text",
"SeqNo": 13,
"StorageSize": 38,
"TimestampDiff": "not-zero-number",
@@ -825,7 +825,7 @@
"Message": "Y29tcHJlc3NlZC1tZXNzYWdlLTI=",
"Offset": 13,
"OriginalSize": 20,
- "ProducerId": "text",
+ "ProducerId": "not-zero-number-text",
"SeqNo": 14,
"StorageSize": 38,
"TimestampDiff": "not-zero-number",
@@ -837,7 +837,7 @@
"Message": "Y29tcHJlc3NlZC1tZXNzYWdlLTM=",
"Offset": 14,
"OriginalSize": 20,
- "ProducerId": "text",
+ "ProducerId": "not-zero-number-text",
"SeqNo": 15,
"StorageSize": 38,
"TimestampDiff": "not-zero-number",
@@ -849,7 +849,7 @@
"Message": "Y29tcHJlc3NlZC1tZXNzYWdlLTQ=",
"Offset": 15,
"OriginalSize": 20,
- "ProducerId": "text",
+ "ProducerId": "not-zero-number-text",
"SeqNo": 16,
"StorageSize": 38,
"TimestampDiff": "not-zero-number",
@@ -878,7 +878,7 @@
],
"Offset": 10,
"OriginalSize": 17,
- "ProducerId": "text",
+ "ProducerId": "not-zero-number-text",
"SeqNo": 11,
"StorageSize": 37,
"TimestampDiff": "not-zero-number",
@@ -897,7 +897,7 @@
"Message": "Y29tcHJlc3NlZC1tZXNzYWdlLTk=",
"Offset": 20,
"OriginalSize": 20,
- "ProducerId": "text",
+ "ProducerId": "not-zero-number-text",
"SeqNo": 21,
"StorageSize": 38,
"TimestampDiff": "not-zero-number",
@@ -916,7 +916,7 @@
"Message": "bWVzc2FnZS0w",
"Offset": 0,
"OriginalSize": 9,
- "ProducerId": "text",
+ "ProducerId": "not-zero-number-text",
"SeqNo": 1,
"StorageSize": 9,
"TimestampDiff": "not-zero-number",
@@ -928,7 +928,7 @@
"Message": "bWVzc2FnZS0x",
"Offset": 1,
"OriginalSize": 9,
- "ProducerId": "text",
+ "ProducerId": "not-zero-number-text",
"SeqNo": 2,
"StorageSize": 9,
"TimestampDiff": "not-zero-number",
@@ -940,7 +940,7 @@
"Message": "bWVzc2FnZS0y",
"Offset": 2,
"OriginalSize": 9,
- "ProducerId": "text",
+ "ProducerId": "not-zero-number-text",
"SeqNo": 3,
"StorageSize": 9,
"TimestampDiff": "not-zero-number",
@@ -952,7 +952,7 @@
"Message": "bWVzc2FnZS0z",
"Offset": 3,
"OriginalSize": 9,
- "ProducerId": "text",
+ "ProducerId": "not-zero-number-text",
"SeqNo": 4,
"StorageSize": 9,
"TimestampDiff": "not-zero-number",
@@ -964,7 +964,7 @@
"Message": "bWVzc2FnZS00",
"Offset": 4,
"OriginalSize": 9,
- "ProducerId": "text",
+ "ProducerId": "not-zero-number-text",
"SeqNo": 5,
"StorageSize": 9,
"TimestampDiff": "not-zero-number",
diff --git a/ydb/core/viewer/viewer_topic_data.cpp b/ydb/core/viewer/viewer_topic_data.cpp
index 16371fe8efa..cb67bb2681e 100644
--- a/ydb/core/viewer/viewer_topic_data.cpp
+++ b/ydb/core/viewer/viewer_topic_data.cpp
@@ -181,7 +181,11 @@ void TTopicData::FillProtoResponse(ui64 maxSingleMessageSize, ui64 maxTotalSize)
setData(*messageProto, std::move(*dataChunk.MutableData()));
}
messageProto->SetCodec(dataChunk.GetCodec());
- messageProto->SetProducerId(r.GetSourceId());
+ TString decodedSrcId;
+ if (!r.GetSourceId().empty()) {
+ decodedSrcId = NPQ::NSourceIdEncoding::Decode(r.GetSourceId());
+ }
+ messageProto->SetProducerId(decodedSrcId);
messageProto->SetSeqNo(r.GetSeqNo());
if (dataChunk.MessageMetaSize() > 0) {