apache / apache/pulsar

[Bug] Cannot compact topic containing compressed messages with properties.

Open
#23,299 4 comments 0 reactions 0 assignees View on GitHub
type/bug
Dominant language
Java
Stars
15.3k
Forks
3.8k
Avg merge
1d 14h
Merged PRs (30d)
160

Description

### Search before asking

- [X] I searched in the [issues](https://github.com/apache/pulsar/issues) and found nothing similar.

### Read release policy

- [X] I understand that unsupported versions don't get bug fixes. I will attempt to reproduce the issue on a supported version of Pulsar client and Pulsar broker.

### Version

3.3.1

### Minimal reproduce step

I was not able to create a reproducible example yet. The situation happened on one of our test environments, on:
- partitioned topic (each of 6 partition is affected)
- two producers writing to a topic
- first producer uses: LZ4, Batching, eventTime, message properties, and both: nullable and non-nullable payload
- second producer uses: Batching, eventTime, message properties, and both: nullable and non-nullable payload

The error Message:
Screenshot 2024-09-12 at 17 46 32

Queries showing activity of __subscription consumers and failed compaction
Screenshot 2024-09-12 at 17 47 20

Constant backlog of the messages:
Screenshot 2024-09-12 at 17 48 36

Stacktrace comes from the recent update of `[RawBatchConverter.java](https://github.com/apache/pulsar/pull/21917/files#diff-91cd32cbdf605810629e9890fb5dd1ee8d7bbee85038aaeb7919ce52a3649f58)`

### What did you expect to see?

The topics are compacted

### What did you see instead?

Compaction on every topic fails, what causes the server to try to compact again.

### Anything else?

_No response_

### Are you willing to submit a PR?

- [ ] I'm willing to submit a PR!

Contributor guide

Open the contributing guide

Research direction

Start by reviewing RawBatchConverter.java from the referenced PR and attempt to reproduce the failure with partitioned topics, batching, compressed messages, event times, properties, and nullable and non-nullable payloads. Compare the compaction failure with the stack trace and verify that affected topics compact successfully without recurring backlog.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
distributed-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.