Skip to content

Commit f9810b6

Browse files
authored
Merge pull request #366 from ydb-platform/fix-alter-topic
Stop sent empty support codec if customer not set it
2 parents 79f22d2 + 55d389e commit f9810b6

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
* Fixed alter topic request - stop send empty setSupportedCodecs if customer not set them
12
* Marked the context errors as required to delete session
23
* Added log topic api reader for internal logger
34

internal/grpcwrapper/rawtopic/alter_topic.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ type AlterTopicRequest struct {
1616
AlterPartitionSettings AlterPartitioningSettings
1717
SetRetentionPeriod rawoptional.Duration
1818
SetRetentionStorageMB rawoptional.Int64
19-
SetSupportedCodecs rawtopiccommon.SupportedCodecs
19+
SetSupportedCodecs bool
20+
SetSupportedCodecsValue rawtopiccommon.SupportedCodecs
2021
SetPartitionWriteSpeedBytesPerSecond rawoptional.Int64
2122
SetPartitionWriteBurstBytes rawoptional.Int64
2223
AlterAttributes map[string]string
@@ -32,12 +33,15 @@ func (req *AlterTopicRequest) ToProto() *Ydb_Topic.AlterTopicRequest {
3233
AlterPartitioningSettings: req.AlterPartitionSettings.ToProto(),
3334
SetRetentionPeriod: req.SetRetentionPeriod.ToProto(),
3435
SetRetentionStorageMb: req.SetRetentionStorageMB.ToProto(),
35-
SetSupportedCodecs: req.SetSupportedCodecs.ToProto(),
3636
SetPartitionWriteSpeedBytesPerSecond: req.SetPartitionWriteSpeedBytesPerSecond.ToProto(),
3737
SetPartitionWriteBurstBytes: req.SetPartitionWriteBurstBytes.ToProto(),
3838
AlterAttributes: req.AlterAttributes,
3939
}
4040

41+
if req.SetSupportedCodecs {
42+
res.SetSupportedCodecs = req.SetSupportedCodecsValue.ToProto()
43+
}
44+
4145
res.AddConsumers = make([]*Ydb_Topic.Consumer, len(req.AddConsumers))
4246
for i := range req.AddConsumers {
4347
res.AddConsumers[i] = req.AddConsumers[i].ToProto()

topic/topicoptions/topicoptions_alter.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,10 @@ func AlterWithRetentionStorageMB(retentionStorageMB int64) AlterOption {
7070
// Notice: This API is EXPERIMENTAL and may be changed or removed in a later release.
7171
func AlterWithSupportedCodecs(codecs ...topictypes.Codec) AlterOption {
7272
return func(req *rawtopic.AlterTopicRequest) {
73-
req.SetSupportedCodecs = make(rawtopiccommon.SupportedCodecs, len(codecs))
73+
req.SetSupportedCodecs = true
74+
req.SetSupportedCodecsValue = make(rawtopiccommon.SupportedCodecs, len(codecs))
7475
for i, codec := range codecs {
75-
req.SetSupportedCodecs[i] = rawtopiccommon.Codec(codec)
76+
req.SetSupportedCodecsValue[i] = rawtopiccommon.Codec(codec)
7677
}
7778
}
7879
}

0 commit comments

Comments
 (0)