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

Fix peek message failure when broker entry metadata is enabled #10924

Conversation

BewareMyPower
Copy link
Contributor

Motivation

When broker entry metadata is enabled, using pulsar-admin to peek messages will fail with

[pulsar-web-29-16] ERROR org.apache.pulsar.broker.admin.impl.PersistentTopicsBase - [null] Failed to peek message at position 1 from persistent://prop/ns-abc/topic-b604aad8ea8010af my-sub
java.lang.IllegalArgumentException: Invalid unknonwn tag type: 6
	at org.apache.pulsar.common.api.proto.LightProtoCodec.skipUnknownField(LightProtoCodec.java:270) ~[classes/:?]
	at org.apache.pulsar.common.api.proto.MessageMetadata.parseFrom(MessageMetadata.java:1370) ~[classes/:?]
	at org.apache.pulsar.common.protocol.Commands.parseMessageMetadata(Commands.java:426) ~[classes/:?]

Modifications

Skip the broker entry metadata if exists in generateResponseWithEntry and add the test to verify it.

Verifying this change

  • Make sure that the change passes the CI checks.

This change added tests and can be verified as follows:

  • Run BrokerEntryMetadataE2ETest#testPeekMessage

Copy link
Contributor

@eolivelli eolivelli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@eolivelli eolivelli added this to the 2.9.0 milestone Jun 15, 2021
@codelipenghui codelipenghui merged commit 7603a9d into apache:master Jun 15, 2021
@BewareMyPower BewareMyPower deleted the bewaremypower/fix-peek-with-broker-entry-metadata branch June 15, 2021 07:36
codelipenghui pushed a commit to codelipenghui/incubator-pulsar that referenced this pull request Jun 15, 2021
…e#10924)

### Motivation

When broker entry metadata is enabled, using pulsar-admin to peek messages will fail with

```
[pulsar-web-29-16] ERROR org.apache.pulsar.broker.admin.impl.PersistentTopicsBase - [null] Failed to peek message at position 1 from persistent://prop/ns-abc/topic-b604aad8ea8010af my-sub
java.lang.IllegalArgumentException: Invalid unknonwn tag type: 6
	at org.apache.pulsar.common.api.proto.LightProtoCodec.skipUnknownField(LightProtoCodec.java:270) ~[classes/:?]
	at org.apache.pulsar.common.api.proto.MessageMetadata.parseFrom(MessageMetadata.java:1370) ~[classes/:?]
	at org.apache.pulsar.common.protocol.Commands.parseMessageMetadata(Commands.java:426) ~[classes/:?]
```

### Modifications

Skip the broker entry metadata if exists in `generateResponseWithEntry` and add the test to verify it.

(cherry picked from commit 7603a9d)
@codelipenghui codelipenghui added the cherry-picked/branch-2.8 Archived: 2.8 is end of life label Jun 15, 2021
eolivelli pushed a commit to datastax/pulsar that referenced this pull request Jun 17, 2021
…e#10924)

### Motivation

When broker entry metadata is enabled, using pulsar-admin to peek messages will fail with

```
[pulsar-web-29-16] ERROR org.apache.pulsar.broker.admin.impl.PersistentTopicsBase - [null] Failed to peek message at position 1 from persistent://prop/ns-abc/topic-b604aad8ea8010af my-sub
java.lang.IllegalArgumentException: Invalid unknonwn tag type: 6
	at org.apache.pulsar.common.api.proto.LightProtoCodec.skipUnknownField(LightProtoCodec.java:270) ~[classes/:?]
	at org.apache.pulsar.common.api.proto.MessageMetadata.parseFrom(MessageMetadata.java:1370) ~[classes/:?]
	at org.apache.pulsar.common.protocol.Commands.parseMessageMetadata(Commands.java:426) ~[classes/:?]
```

### Modifications

Skip the broker entry metadata if exists in `generateResponseWithEntry` and add the test to verify it.

(cherry picked from commit 7603a9d)
(cherry picked from commit 77f8a4f)
yangl pushed a commit to yangl/pulsar that referenced this pull request Jun 23, 2021
…e#10924)

### Motivation

When broker entry metadata is enabled, using pulsar-admin to peek messages will fail with

```
[pulsar-web-29-16] ERROR org.apache.pulsar.broker.admin.impl.PersistentTopicsBase - [null] Failed to peek message at position 1 from persistent://prop/ns-abc/topic-b604aad8ea8010af my-sub
java.lang.IllegalArgumentException: Invalid unknonwn tag type: 6
	at org.apache.pulsar.common.api.proto.LightProtoCodec.skipUnknownField(LightProtoCodec.java:270) ~[classes/:?]
	at org.apache.pulsar.common.api.proto.MessageMetadata.parseFrom(MessageMetadata.java:1370) ~[classes/:?]
	at org.apache.pulsar.common.protocol.Commands.parseMessageMetadata(Commands.java:426) ~[classes/:?]
```

### Modifications

Skip the broker entry metadata if exists in `generateResponseWithEntry` and add the test to verify it.
bharanic-dev pushed a commit to bharanic-dev/pulsar that referenced this pull request Mar 18, 2022
…e#10924)

### Motivation

When broker entry metadata is enabled, using pulsar-admin to peek messages will fail with

```
[pulsar-web-29-16] ERROR org.apache.pulsar.broker.admin.impl.PersistentTopicsBase - [null] Failed to peek message at position 1 from persistent://prop/ns-abc/topic-b604aad8ea8010af my-sub
java.lang.IllegalArgumentException: Invalid unknonwn tag type: 6
	at org.apache.pulsar.common.api.proto.LightProtoCodec.skipUnknownField(LightProtoCodec.java:270) ~[classes/:?]
	at org.apache.pulsar.common.api.proto.MessageMetadata.parseFrom(MessageMetadata.java:1370) ~[classes/:?]
	at org.apache.pulsar.common.protocol.Commands.parseMessageMetadata(Commands.java:426) ~[classes/:?]
```

### Modifications

Skip the broker entry metadata if exists in `generateResponseWithEntry` and add the test to verify it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cherry-picked/branch-2.8 Archived: 2.8 is end of life release/2.8.1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants