You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by "coderzc (via GitHub)" <gi...@apache.org> on 2023/11/08 06:49:25 UTC

[PR] [improve][pip] PIP-318: Don't retain null-key messages during topic compaction [pulsar]

coderzc opened a new pull request, #21541:
URL: https://github.com/apache/pulsar/pull/21541

   Motivation & Modifications
   Start a PIP: Don't retain null-key messages during topic compaction
   
   ### Documentation
   
   <!-- DO NOT REMOVE THIS SECTION. CHECK THE PROPER BOX ONLY. -->
   
   - [ ] `doc` <!-- Your PR contains doc changes. -->
   - [ ] `doc-required` <!-- Your PR changes impact docs and you will update later -->
   - [x] `doc-not-needed` <!-- Your PR changes do not impact docs -->
   - [ ] `doc-complete` <!-- Docs have been already added -->
   
   ### Matching PR in forked repository
   
   PR in forked repository: <!-- ENTER URL HERE -->
   
   <!--
   After opening this PR, the build in apache/pulsar will fail and instructions will
   be provided for opening a PR in the PR author's forked repository.
   
   apache/pulsar pull requests should be first tested in your own fork since the 
   apache/pulsar CI based on GitHub Actions has constrained resources and quota.
   GitHub Actions provides separate quota for pull requests that are executed in 
   a forked repository.
   
   The tests will be run in the forked repository until all PR review comments have
   been handled, the tests pass and the PR is approved by a reviewer.
   -->
   


-- 
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: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [improve][pip] PIP-318: Don't retain null-key messages during topic compaction [pulsar]

Posted by "coderzc (via GitHub)" <gi...@apache.org>.
coderzc commented on code in PR #21541:
URL: https://github.com/apache/pulsar/pull/21541#discussion_r1390606449


##########
pip/pip-318.md:
##########
@@ -0,0 +1,49 @@
+# PIP-318: Don't retain null-key messages during topic compaction
+
+# Background knowledge
+
+Apache Pulsar is supported [Topic Compaction](https://pulsar.apache.org/docs/en/concepts-topic-compaction/) which is a key-based data retention mechanism. 
+
+# Motivation
+
+Currently, we retain all null-key messages during topic compaction, which I don't think is necessary because when you use topic compaction, it means that you want to retain the value according to the key, so retaining null-key messages is meaningless.
+
+Additionally, retaining all null-key messages will double the storage cost, and we'll never be able to clean them up since the compacted topic has not supported the retention policy yet.
+
+In summary, I don't think we should retain null-key messages during topic compaction.
+
+# Goals
+
+# High Level Design
+
+In order to avoid introducing break changes to release version, we need to add a configuration to control whether to retain null-key messages during topic compaction.
+If the configuration is true, we will retain null-key messages during topic compaction, otherwise, we will not retain null-key messages during topic compaction.
+
+## Public-facing Changes
+
+### Configuration
+
+Add config to broker.conf
+```properties
+compactionRemainNullKey=false

Review Comment:
   `topicCompactionRemainNullKey` seems to be better since it needs to cherry-pick to the old branch.



-- 
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: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [improve][pip] PIP-318: Don't retain null-key messages during topic compaction [pulsar]

Posted by "coderzc (via GitHub)" <gi...@apache.org>.
coderzc commented on code in PR #21541:
URL: https://github.com/apache/pulsar/pull/21541#discussion_r1390606449


##########
pip/pip-318.md:
##########
@@ -0,0 +1,49 @@
+# PIP-318: Don't retain null-key messages during topic compaction
+
+# Background knowledge
+
+Apache Pulsar is supported [Topic Compaction](https://pulsar.apache.org/docs/en/concepts-topic-compaction/) which is a key-based data retention mechanism. 
+
+# Motivation
+
+Currently, we retain all null-key messages during topic compaction, which I don't think is necessary because when you use topic compaction, it means that you want to retain the value according to the key, so retaining null-key messages is meaningless.
+
+Additionally, retaining all null-key messages will double the storage cost, and we'll never be able to clean them up since the compacted topic has not supported the retention policy yet.
+
+In summary, I don't think we should retain null-key messages during topic compaction.
+
+# Goals
+
+# High Level Design
+
+In order to avoid introducing break changes to release version, we need to add a configuration to control whether to retain null-key messages during topic compaction.
+If the configuration is true, we will retain null-key messages during topic compaction, otherwise, we will not retain null-key messages during topic compaction.
+
+## Public-facing Changes
+
+### Configuration
+
+Add config to broker.conf
+```properties
+compactionRemainNullKey=false

Review Comment:
   `topicCompactionRemainNullKey` seems to be better, as it requires cherry-picking to the old branch.



##########
pip/pip-318.md:
##########
@@ -0,0 +1,49 @@
+# PIP-318: Don't retain null-key messages during topic compaction
+
+# Background knowledge
+
+Apache Pulsar is supported [Topic Compaction](https://pulsar.apache.org/docs/en/concepts-topic-compaction/) which is a key-based data retention mechanism. 
+
+# Motivation
+
+Currently, we retain all null-key messages during topic compaction, which I don't think is necessary because when you use topic compaction, it means that you want to retain the value according to the key, so retaining null-key messages is meaningless.
+
+Additionally, retaining all null-key messages will double the storage cost, and we'll never be able to clean them up since the compacted topic has not supported the retention policy yet.
+
+In summary, I don't think we should retain null-key messages during topic compaction.
+
+# Goals
+
+# High Level Design
+
+In order to avoid introducing break changes to release version, we need to add a configuration to control whether to retain null-key messages during topic compaction.
+If the configuration is true, we will retain null-key messages during topic compaction, otherwise, we will not retain null-key messages during topic compaction.
+
+## Public-facing Changes
+
+### Configuration
+
+Add config to broker.conf
+```properties
+compactionRemainNullKey=false
+```
+
+# Backward & Forward Compatibility
+
+- Make `compactionRemainNullKey=false` default  in the 3.2.0.
+- Cherry-pick it to a branch less than 3.2.0 make `compactionRemainNullKey=true` default.
+- Delete the configuration `compactionRemainNullKey` in 3.3.0 and don't supply an option to retain null-keys.
+
+## Revert
+
+Make `compactionRemainNullKey=true` in broker.conf.

Review Comment:
   Ok.



-- 
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: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [improve][pip] PIP-318: Don't retain null-key messages during topic compaction [pulsar]

Posted by "mattisonchao (via GitHub)" <gi...@apache.org>.
mattisonchao commented on code in PR #21541:
URL: https://github.com/apache/pulsar/pull/21541#discussion_r1390584365


##########
pip/pip-318.md:
##########
@@ -0,0 +1,49 @@
+# PIP-318: Don't retain null-key messages during topic compaction
+
+# Background knowledge
+
+Apache Pulsar is supported [Topic Compaction](https://pulsar.apache.org/docs/en/concepts-topic-compaction/) which is a key-based data retention mechanism. 
+
+# Motivation
+
+Currently, we retain all null-key messages during topic compaction, which I don't think is necessary because when you use topic compaction, it means that you want to retain the value according to the key, so retaining null-key messages is meaningless.
+
+Additionally, retaining all null-key messages will double the storage cost, and we'll never be able to clean them up since the compacted topic has not supported the retention policy yet.
+
+In summary, I don't think we should retain null-key messages during topic compaction.
+
+# Goals
+
+# High Level Design
+
+In order to avoid introducing break changes to release version, we need to add a configuration to control whether to retain null-key messages during topic compaction.
+If the configuration is true, we will retain null-key messages during topic compaction, otherwise, we will not retain null-key messages during topic compaction.
+
+## Public-facing Changes
+
+### Configuration
+
+Add config to broker.conf
+```properties
+compactionRemainNullKey=false
+```
+
+# Backward & Forward Compatibility
+
+- Make `compactionRemainNullKey=false` default  in the 3.2.0.
+- Cherry-pick it to a branch less than 3.2.0 make `compactionRemainNullKey=true` default.
+- Delete the configuration `compactionRemainNullKey` in 3.3.0 and don't supply an option to retain null-keys.
+
+## Revert
+
+Make `compactionRemainNullKey=true` in broker.conf.

Review Comment:
   and `standalone` also.



-- 
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: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [improve][pip] PIP-318: Don't retain null-key messages during topic compaction [pulsar]

Posted by "coderzc (via GitHub)" <gi...@apache.org>.
coderzc commented on PR #21541:
URL: https://github.com/apache/pulsar/pull/21541#issuecomment-1809485211

   Merge this PIP, since the vote has been approved: https://lists.apache.org/thread/36rfmvz5rchgnvqb2wcq4wb64k6st90p


-- 
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: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [improve][pip] PIP-318: Don't retain null-key messages during topic compaction [pulsar]

Posted by "mattisonchao (via GitHub)" <gi...@apache.org>.
mattisonchao commented on code in PR #21541:
URL: https://github.com/apache/pulsar/pull/21541#discussion_r1390584181


##########
pip/pip-318.md:
##########
@@ -0,0 +1,49 @@
+# PIP-318: Don't retain null-key messages during topic compaction
+
+# Background knowledge
+
+Apache Pulsar is supported [Topic Compaction](https://pulsar.apache.org/docs/en/concepts-topic-compaction/) which is a key-based data retention mechanism. 
+
+# Motivation
+
+Currently, we retain all null-key messages during topic compaction, which I don't think is necessary because when you use topic compaction, it means that you want to retain the value according to the key, so retaining null-key messages is meaningless.
+
+Additionally, retaining all null-key messages will double the storage cost, and we'll never be able to clean them up since the compacted topic has not supported the retention policy yet.
+
+In summary, I don't think we should retain null-key messages during topic compaction.
+
+# Goals
+
+# High Level Design
+
+In order to avoid introducing break changes to release version, we need to add a configuration to control whether to retain null-key messages during topic compaction.
+If the configuration is true, we will retain null-key messages during topic compaction, otherwise, we will not retain null-key messages during topic compaction.
+
+## Public-facing Changes
+
+### Configuration
+
+Add config to broker.conf
+```properties
+compactionRemainNullKey=false

Review Comment:
   `topicCompactionServiceRemainNullKey? `



-- 
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: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [improve][pip] PIP-318: Don't retain null-key messages during topic compaction [pulsar]

Posted by "mattisonchao (via GitHub)" <gi...@apache.org>.
mattisonchao commented on PR #21541:
URL: https://github.com/apache/pulsar/pull/21541#issuecomment-1807572678

   +1 (binding)
   
   
   Best,
   Mattison
   
   > On Nov 13, 2023, at 15:03, Qiang Zhao ***@***.***> wrote:
   > 
   > 
   > @mattisonchao commented on this pull request.
   > 
   > In pip/pip-318.md <https://github.com/apache/pulsar/pull/21541#discussion_r1390683850>:
   > 
   > > +In summary, I don't think we should retain null-key messages during topic compaction.
   > +
   > +# Goals
   > +
   > +# High Level Design
   > +
   > +In order to avoid introducing break changes to release version, we need to add a configuration to control whether to retain null-key messages during topic compaction.
   > +If the configuration is true, we will retain null-key messages during topic compaction, otherwise, we will not retain null-key messages during topic compaction.
   > +
   > +## Public-facing Changes
   > +
   > +### Configuration
   > +
   > +Add config to broker.conf
   > +```properties
   > +compactionRemainNullKey=false
   > Agree.
   > 
   > —
   > Reply to this email directly, view it on GitHub <https://github.com/apache/pulsar/pull/21541#discussion_r1390683850>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AR2NWCYBK5ORHVYUB35QX6LYEHA4FAVCNFSM6AAAAAA7CLQEYCVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMYTOMRWGYZTOMZYGY>.
   > You are receiving this because you are subscribed to this thread.
   > 
   
   


-- 
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: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [improve][pip] PIP-318: Don't retain null-key messages during topic compaction [pulsar]

Posted by "coderzc (via GitHub)" <gi...@apache.org>.
coderzc merged PR #21541:
URL: https://github.com/apache/pulsar/pull/21541


-- 
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: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [improve][pip] PIP-318: Don't retain null-key messages during topic compaction [pulsar]

Posted by "mattisonchao (via GitHub)" <gi...@apache.org>.
mattisonchao commented on code in PR #21541:
URL: https://github.com/apache/pulsar/pull/21541#discussion_r1390683850


##########
pip/pip-318.md:
##########
@@ -0,0 +1,49 @@
+# PIP-318: Don't retain null-key messages during topic compaction
+
+# Background knowledge
+
+Apache Pulsar is supported [Topic Compaction](https://pulsar.apache.org/docs/en/concepts-topic-compaction/) which is a key-based data retention mechanism. 
+
+# Motivation
+
+Currently, we retain all null-key messages during topic compaction, which I don't think is necessary because when you use topic compaction, it means that you want to retain the value according to the key, so retaining null-key messages is meaningless.
+
+Additionally, retaining all null-key messages will double the storage cost, and we'll never be able to clean them up since the compacted topic has not supported the retention policy yet.
+
+In summary, I don't think we should retain null-key messages during topic compaction.
+
+# Goals
+
+# High Level Design
+
+In order to avoid introducing break changes to release version, we need to add a configuration to control whether to retain null-key messages during topic compaction.
+If the configuration is true, we will retain null-key messages during topic compaction, otherwise, we will not retain null-key messages during topic compaction.
+
+## Public-facing Changes
+
+### Configuration
+
+Add config to broker.conf
+```properties
+compactionRemainNullKey=false

Review Comment:
   Agree. 



-- 
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: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org