Skip to content

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

Merged
codelipenghui merged 1 commit into
apache:masterfrom
BewareMyPower:bewaremypower/fix-peek-with-broker-entry-metadata
Jun 15, 2021
Merged

codelipenghui merged 1 commit into
apache:masterfrom
BewareMyPower:bewaremypower/fix-peek-with-broker-entry-metadata

Conversation

@BewareMyPower

Copy link
Copy Markdown
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

@BewareMyPower BewareMyPower self-assigned this Jun 15, 2021

@eolivelli eolivelli left a comment

Copy link
Copy Markdown
Contributor

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.

3 participants