redpanda-data / redpanda

Redpanda is a streaming data platform for developers. Kafka API compatible. 10x faster. No ZooKeeper. No JVM!
https://redpanda.com
9.65k stars 589 forks source link

Alter topic config does not work if the value happens to be the inherited default (regression) #21360

Open weeco opened 4 months ago

weeco commented 4 months ago

Version & Environment

Redpanda version: (use rpk version): v23.3.18

What went wrong?

Altering the topic config does not work if the new topic config happens to be the currently inherited default, see the following example and pay attention to the config source, that is reported on the Describe response:

$ rpk topic alter-config test --set cleanup.policy=delete 
TOPIC  STATUS
test   OK
$ rpk topic describe test
SUMMARY
=======
NAME        test
PARTITIONS  1
REPLICAS    1

CONFIGS
=======
KEY                                   VALUE       SOURCE
cleanup.policy                        delete      DEFAULT_CONFIG
compression.type                      producer    DEFAULT_CONFIG
initial.retention.local.target.bytes  -1          DEFAULT_CONFIG
initial.retention.local.target.ms     -1          DEFAULT_CONFIG
max.message.bytes                     1048576     DEFAULT_CONFIG
message.timestamp.type                CreateTime  DEFAULT_CONFIG
redpanda.remote.delete                true        DEFAULT_CONFIG
redpanda.remote.read                  false       DEFAULT_CONFIG
redpanda.remote.write                 false       DEFAULT_CONFIG
retention.bytes                       -1          DEFAULT_CONFIG
retention.local.target.bytes          -1          DEFAULT_CONFIG
retention.local.target.ms             86400000    DEFAULT_CONFIG
retention.ms                          604800000   DEFAULT_CONFIG
segment.bytes                         134217728   DEFAULT_CONFIG
segment.ms                            1209600000  DEFAULT_CONFIG

If i do the same but change the value to compact (which is not the inherited default), it seems to work. Unclear whether the alter-config or the describe configs is the problem here.

$ rpk topic alter-config test --set cleanup.policy=compact 
TOPIC  STATUS
test   OK
$ rpk topic describe test
SUMMARY
=======
NAME        test
PARTITIONS  1
REPLICAS    1

CONFIGS
=======
KEY                                   VALUE       SOURCE
cleanup.policy                        compact     DYNAMIC_TOPIC_CONFIG
compression.type                      producer    DEFAULT_CONFIG
initial.retention.local.target.bytes  -1          DEFAULT_CONFIG
initial.retention.local.target.ms     -1          DEFAULT_CONFIG
max.message.bytes                     1048576     DEFAULT_CONFIG
message.timestamp.type                CreateTime  DEFAULT_CONFIG
redpanda.remote.delete                true        DEFAULT_CONFIG
redpanda.remote.read                  false       DEFAULT_CONFIG
redpanda.remote.write                 false       DEFAULT_CONFIG
retention.bytes                       -1          DEFAULT_CONFIG
retention.local.target.bytes          -1          DEFAULT_CONFIG
retention.local.target.ms             86400000    DEFAULT_CONFIG
retention.ms                          604800000   DEFAULT_CONFIG
segment.bytes                         268435456   DEFAULT_CONFIG
segment.ms                            1209600000  DEFAULT_CONFIG

What should have happened instead?

The reported source when altering the topic config cleanup.policy to delete should be DYNAMIC_TOPIC_CONFIG. It doesn't matter whether the inherited default happens to be the same value.

How to reproduce the issue?

  1. Start v23.3.18 container
  2. Run rpk commands from above

Additional information

This fails some integration tests in Console. This definetely used to work in a previous Redpanda version.

JIRA Link: CORE-5582

michael-redpanda commented 4 months ago

I think this is a dup of https://github.com/redpanda-data/redpanda/issues/18275?

github-actions[bot] commented 1 month ago

This issue hasn't seen activity in 3 months. If you want to keep it open, post a comment or remove the stale label – otherwise this will be closed in two weeks.