BewareMyPower commented on code in PR #24431:
URL: https://github.com/apache/pulsar/pull/24431#discussion_r2159974242
##########
pulsar-broker/src/main/java/org/apache/pulsar/compaction/Compactor.java:
##########
@@ -35,6 +35,7 @@ public abstract class Compactor {
private static final Logger log = LoggerFactory.getLogger(Compactor.class);
public static final String COMPACTION_SUBSCRIPTION = "__compaction";
public static final String COMPACTED_TOPIC_LEDGER_PROPERTY =
"CompactedTopicLedger";
+ public static final String RETAINED_MESSAGE_COUNT_PROPERTY =
"RetainedMessageCount";
Review Comment:
No. The background is complicated. I'm writing a proposal to fix the root
cause.
This draft implementation might help you understand:
https://github.com/BewareMyPower/pulsar/pull/42/files#diff-f2b074eb97e870ec15676e349d61de41fc94067e2b01e86335d05b4bc4019407
i.e. the customized compaction service could use a property to determine
which messages are compacted out rather than checking the `compactedOut` field.
The root cause is that each entry is guaranteed to have a `MessageMetadata`,
even the message was produced via the protocol handler, but it's not guaranteed
to have a `SingleMessageMetadata`.
You can also wait for my proposal (PIP-429) to be available
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]