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

How to remove Kafka Topic Config entry using API? (OpType.DELETE from kafka-config cli) #1830

Open
ajanikow opened this issue Nov 13, 2020 · 10 comments · Fixed by #1966
Open
Labels
stale Issues and pull requests without any recent activity

Comments

@ajanikow
Copy link
Contributor

ajanikow commented Nov 13, 2020

Versions
Sarama Kafka Go
v1.27.2 2.4.0 1.14
Configuration

Any kind of connection (SASL_PLAINTEXT, SASL_SSL, SSL), Kafka API version "2.4.0".

Logs

From Client application: EOF

From Server:

org.apache.kafka.common.errors.InvalidRequestException: Error getting request for apiKey: ALTER_CONFIGS, apiVersion: 0, connectionId: <HIDDEN>
Caused by: java.lang.NullPointerException: value
        at java.util.Objects.requireNonNull(Objects.java:228)
        at org.apache.kafka.common.requests.AlterConfigsRequest$ConfigEntry.<init>(AlterConfigsRequest.java:92)
        at org.apache.kafka.common.requests.AlterConfigsRequest.<init>(AlterConfigsRequest.java:149)
        at org.apache.kafka.common.requests.AbstractRequest.parseRequest(AbstractRequest.java:213)
        at org.apache.kafka.common.requests.RequestContext.parseRequest(RequestContext.java:70)
        at kafka.network.RequestChannel$Request.<init>(RequestChannel.scala:96)
        at kafka.network.Processor.$anonfun$processCompletedReceives$1(SocketServer.scala:923)
        at kafka.network.Processor.$anonfun$processCompletedReceives$1$adapted(SocketServer.scala:903)
        at scala.collection.Iterator.foreach(Iterator.scala:941)
        at scala.collection.Iterator.foreach$(Iterator.scala:941)
        at scala.collection.AbstractIterator.foreach(Iterator.scala:1429)
        at scala.collection.IterableLike.foreach(IterableLike.scala:74)
        at scala.collection.IterableLike.foreach$(IterableLike.scala:73)
        at scala.collection.AbstractIterable.foreach(Iterable.scala:56)
        at kafka.network.Processor.processCompletedReceives(SocketServer.scala:903)
        at kafka.network.Processor.run(SocketServer.scala:793)
        at java.lang.Thread.run(Thread.java:748)

Problem Description

Hello!

I want to remove configuration from Kafka Topic (in principal restore it to default value).

I tried to:

  • set it to empty - validation fails
  • set it to nil - error like above
  • set it to default from Kafka - but option is not marked as default anymore

Is there any possibility to revert this value (restore to default) using Sarama?

Using Kafka CLI kafka-config I'm able to restore default value.

Best Regards,
Adam.

@royantman
Copy link

royantman commented Dec 2, 2020

It looks like Sarama is doing the right thing when encoding the request, the value is supposed to be NULLABLE_STRING.
Kafka however pretty much ignores the protocol documented as they do this in their code:

https://github.com/apache/kafka/blob/aeeb7b2f9a9abe8f49543a2278757722e5974cb3/clients/src/main/java/org/apache/kafka/common/requests/AlterConfigsRequest.java#L50-L52

Now I'm curios as to how deleting configs via CLI works...

(Update)
CLI admin client is using a different API (44, IncrementalAlterConfigs)

@ghost

This comment was marked as outdated.

@ghost ghost added the stale Issues and pull requests without any recent activity label Mar 16, 2021
@stoeffel
Copy link

Is there any update on this issue? Does a workaround for removing config entries exist? Thanks ❤️

@ghost ghost removed the stale Issues and pull requests without any recent activity label May 13, 2021
@ajanikow
Copy link
Contributor Author

@stoeffel You can just dump current config, remove expected key from map, apply it again (we do it currently for Topics, but for broker Dynamic config it does not work)

@fengyinqiao
Copy link
Contributor

When to support it in admin.go?@ajanikow @dnwe

@github-actions

This comment was marked as outdated.

@github-actions github-actions bot added the stale Issues and pull requests without any recent activity label Aug 25, 2023
@dnwe
Copy link
Collaborator

dnwe commented Aug 29, 2023

Can this now be solved via #2088 and the IncrementalAlterConfigsOperationDelete operation?

@github-actions github-actions bot removed the stale Issues and pull requests without any recent activity label Aug 29, 2023

This comment was marked as outdated.

@github-actions github-actions bot added stale Issues and pull requests without any recent activity and removed stale Issues and pull requests without any recent activity labels Nov 27, 2023

This comment was marked as outdated.

@github-actions github-actions bot added stale Issues and pull requests without any recent activity and removed stale Issues and pull requests without any recent activity labels Feb 26, 2024
Copy link

Thank you for taking the time to raise this issue. However, it has not had any activity on it in the past 90 days and will be closed in 30 days if no updates occur.
Please check if the main branch has already resolved the issue since it was raised. If you believe the issue is still valid and you would like input from the maintainers then please comment to ask for it to be reviewed.

@github-actions github-actions bot added the stale Issues and pull requests without any recent activity label May 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale Issues and pull requests without any recent activity
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants