Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incremental Alter Config operation kills connection #16281

Closed
weeco opened this issue Jan 24, 2024 · 1 comment · Fixed by #16399
Closed

Incremental Alter Config operation kills connection #16281

weeco opened this issue Jan 24, 2024 · 1 comment · Fixed by #16399
Assignees
Labels
area/kafka kind/bug Something isn't working sev/medium Bugs that do not meet criteria for high or critical, but are more severe than low.

Comments

@weeco
Copy link

weeco commented Jan 24, 2024

Version & Environment

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

What went wrong?

When sending the following franz-go request the connection seems to get killed by Redpanda and no response is sent to the Kafka client. This generally seems to be happening for any request with an invalid value for the to be set config value (e.g. you can use some-wrong-val for cleanup.policy and the same issue will happen).

ss-hWCi4Xcj

What should have happened instead?

If something is wrong with this request, an appropriate error response should be returned in this case. I assume INVALID_CONFIG, error code 40 with a proper message would be a good response.

Apache Kafka returns the following error for cleanup.policy = compactt:

Message: Invalid value compactt for configuration cleanup.policy: String must be one of: compact, delete
Error Code: 40 / INVALID_CONFIG

and for compression.type = SNAPPY:

Message: Invalid value SNAPPY for configuration compression.type: String must be one of: uncompressed, zstd, lz4, snappy, gzip, producer
Error Code: 40 / INVALID_CONFIG

Redpanda should return the same.

How to reproduce the issue?

  1. Send an incremental alter config request constructed like shown in my screenshot

Additional information

The Redpanda server logs the following log line:

2024-01-24 22:30:02 WARN  2024-01-24 22:30:02,605 [shard 0:main] kafka - connection_context.cc:675 - Error processing request: std::runtime_error (Fell off the end of a string-switch while matching: SNAPPY)

From the client perspective I get the following log message printed by franz-go:

{"level":"warn","ts":"2024-01-24T22:29:57.585Z","logger":"kafka_client","msg":"read from broker errored, killing connection after 0 successful responses (is SASL missing?)","addr":"localhost:9092","broker":"seed_0","err":"EOF"}
@weeco weeco added the kind/bug Something isn't working label Jan 24, 2024
@emaxerrno
Copy link
Contributor

good idea on returning the error code.

@michael-redpanda michael-redpanda added the sev/medium Bugs that do not meet criteria for high or critical, but are more severe than low. label Jan 25, 2024
graphcareful added a commit to graphcareful/redpanda that referenced this issue Jan 31, 2024
- incremental_alter_configs requests were killing connections when
requests supplied an invalid string as a compression_type argument.

- The method lexical_cast invokes to convert a compression to a string
contains a string_switch method without a default clause, this throws
when no matches are found. The solution is to wrap the call to
lexical_cast in a try/catch clause.

- Fixes: redpanda-data#16281
@graphcareful graphcareful self-assigned this Jan 31, 2024
vbotbuildovich pushed a commit to vbotbuildovich/redpanda that referenced this issue Jan 31, 2024
- incremental_alter_configs requests were killing connections when
requests supplied an invalid string as a compression_type argument.

- The method lexical_cast invokes to convert a compression to a string
contains a string_switch method without a default clause, this throws
when no matches are found. The solution is to wrap the call to
lexical_cast in a try/catch clause.

- Fixes: redpanda-data#16281

(cherry picked from commit 63efdf2)
vbotbuildovich pushed a commit to vbotbuildovich/redpanda that referenced this issue Jan 31, 2024
- incremental_alter_configs requests were killing connections when
requests supplied an invalid string as a compression_type argument.

- The method lexical_cast invokes to convert a compression to a string
contains a string_switch method without a default clause, this throws
when no matches are found. The solution is to wrap the call to
lexical_cast in a try/catch clause.

- Fixes: redpanda-data#16281

(cherry picked from commit 63efdf2)
vbotbuildovich pushed a commit to vbotbuildovich/redpanda that referenced this issue Jan 31, 2024
- incremental_alter_configs requests were killing connections when
requests supplied an invalid string as a compression_type argument.

- The method lexical_cast invokes to convert a compression to a string
contains a string_switch method without a default clause, this throws
when no matches are found. The solution is to wrap the call to
lexical_cast in a try/catch clause.

- Fixes: redpanda-data#16281

(cherry picked from commit 63efdf2)
ballard26 pushed a commit to ballard26/redpanda that referenced this issue Feb 2, 2024
- incremental_alter_configs requests were killing connections when
requests supplied an invalid string as a compression_type argument.

- The method lexical_cast invokes to convert a compression to a string
contains a string_switch method without a default clause, this throws
when no matches are found. The solution is to wrap the call to
lexical_cast in a try/catch clause.

- Fixes: redpanda-data#16281
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/kafka kind/bug Something isn't working sev/medium Bugs that do not meet criteria for high or critical, but are more severe than low.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants