Skip to content

Conversation

fuyou001
Copy link
Contributor

Which Issue(s) This PR Fixes

Fixes #9692

Brief Description

Support asynchronous deletion of topics to improve performance

How Did You Test This Change?

Signed-off-by: fuchong <yubao.fyb@alibaba-inc.com>

Signed-off-by: fuchong <yubao.fyb@alibaba-inc.com>

Signed-off-by: fuchong <yubao.fyb@alibaba-inc.com>
@ankit-kumarz
Copy link

The main cause of failure in job 50213573092 is repeated errors related to decoding the custom field , specifically:

org.apache.rocketmq.remoting.exception.RemotingCommandException: the custom field <defaultTopic> is null
	at org.apache.rocketmq.remoting.protocol.RemotingCommand.decodeCommandCustomHeaderDirectly(RemotingCommand.java:307)

This error occurs multiple times during topic creation and update operations, indicating that the field defaultTopic is expected but not set or is being passed as null in requests to the broker.

Solution:

  1. Ensure defaultTopic Is Set in Requests**
  • Check all places where requests are made to create or update topics, especially in tests and any client code.
  • Make sure the request header includes a non-null value for defaultTopic where it's required.

Example Fix in Java:
If you are constructing a request using a command header, ensure you set defaultTopic:

java:-
YourCustomHeader header = new YourCustomHeader();
header.setDefaultTopic("YOUR_TOPIC_NAME"); // Set to an appropriate topic name
remotingCommand.setCustomHeader(header);


2. Add Null Checks in Broker/Processor Code

- In `RemotingCommand.decodeCommandCustomHeaderDirectly`, add a null check and handle missing fields more gracefully, possibly with a default value or clear error message.

Example Defensive Code:
```java
if (customHeader.getDefaultTopic() == null) {
    throw new RemotingCommandException("The custom field <defaultTopic> must not be null");
}

But ideally, the fix should be at the source (where the request is constructed), not just error handling.

  1. Review Test Definitions**

Several log entries suggest the issue may be in the integration tests for topic creation. Check test files for topic creation requests, and verify that defaultTopic is set.

Additional Error: NullPointerException in setCommitLogReadaheadMode

java.lang.NullPointerException: null
at org.apache.rocketmq.broker.processor.AdminBrokerProcessor.setCommitLogReadaheadMode(AdminBrokerProcessor.java:1050)

Solution: Add null checks for the objects used inside setCommitLogReadaheadMode. Ensure all required arguments are initialized before use.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Enhancement] Support async delete for topics

2 participants