This is an automated email from the ASF dual-hosted git repository.
lhotari pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/pulsar-site.git
The following commit(s) were added to refs/heads/main by this push:
new ffde2638b96a Add steps to remove compaction in a topic (#914)
ffde2638b96a is described below
commit ffde2638b96ac29a667db6d5e2d7323e3afad0c1
Author: Alvaro <[email protected]>
AuthorDate: Tue Oct 29 08:37:27 2024 +0100
Add steps to remove compaction in a topic (#914)
* Solves apache/pulsar/issues/22896
Add steps to remove compaction in a topic
* Adding changes to version 3.3.x
* Improve grammar and apply to maintained versions
---------
Co-authored-by: Lari Hotari <[email protected]>
---
docs/cookbooks-compaction.md | 28 ++++++++++++++++++++++
.../version-3.0.x/cookbooks-compaction.md | 28 ++++++++++++++++++++++
.../version-3.3.x/cookbooks-compaction.md | 28 ++++++++++++++++++++++
.../version-4.0.x/cookbooks-compaction.md | 28 ++++++++++++++++++++++
4 files changed, 112 insertions(+)
diff --git a/docs/cookbooks-compaction.md b/docs/cookbooks-compaction.md
index 8de0929a08ed..62cbc4d9c58c 100644
--- a/docs/cookbooks-compaction.md
+++ b/docs/cookbooks-compaction.md
@@ -125,3 +125,31 @@ compactedTopicProducer.newMessage()
.value(someByteArray)
.send();
```
+
+## Remove compaction from a topic
+
+Since versions `2.11.4`, `3.0.3`, and `3.1.0` (with [PR
21745](https://github.com/apache/pulsar/pull/21745)), you can remove compaction
by removing the `__compaction` subscription.
+
+```shell
+bin/pulsar-admin topics unsubscribe {topic} -s __compaction
+```
+
+Before versions `2.11.4`, `3.0.3`, and `3.1.0`, if you wanted to remove
compaction from a topic, you needed access to the BookKeeper shell to remove
the compaction data. The steps are:
+
+1. Get the compacted ledgerId from the compactedLedger of stats-internal
+
+```shell
+bin/pulsar-admin topics stats-internal {topic}
+```
+
+2. Delete the compacted ledger
+
+```shell
+bin/bookkeeper shell deleteledger {compacted_ledger}
+```
+
+3. Unload the topic to clear the cache on the broker
+
+```shell
+bin/pulsar-admin topics unload {topic}
+```
diff --git a/versioned_docs/version-3.0.x/cookbooks-compaction.md
b/versioned_docs/version-3.0.x/cookbooks-compaction.md
index 27def1770765..98a484b998dd 100644
--- a/versioned_docs/version-3.0.x/cookbooks-compaction.md
+++ b/versioned_docs/version-3.0.x/cookbooks-compaction.md
@@ -118,3 +118,31 @@ compactedTopicProducer.newMessage()
.value(someByteArray)
.send();
```
+
+## Remove compaction from a topic
+
+Since versions `2.11.4`, `3.0.3`, and `3.1.0` (with [PR
21745](https://github.com/apache/pulsar/pull/21745)), you can remove compaction
by removing the `__compaction` subscription.
+
+```shell
+bin/pulsar-admin topics unsubscribe {topic} -s __compaction
+```
+
+Before versions `2.11.4`, `3.0.3`, and `3.1.0`, if you wanted to remove
compaction from a topic, you needed access to the BookKeeper shell to remove
the compaction data. The steps are:
+
+1. Get the compacted ledgerId from the compactedLedger of stats-internal
+
+```shell
+bin/pulsar-admin topics stats-internal {topic}
+```
+
+2. Delete the compacted ledger
+
+```shell
+bin/bookkeeper shell deleteledger {compacted_ledger}
+```
+
+3. Unload the topic to clear the cache on the broker
+
+```shell
+bin/pulsar-admin topics unload {topic}
+```
diff --git a/versioned_docs/version-3.3.x/cookbooks-compaction.md
b/versioned_docs/version-3.3.x/cookbooks-compaction.md
index 8de0929a08ed..62cbc4d9c58c 100644
--- a/versioned_docs/version-3.3.x/cookbooks-compaction.md
+++ b/versioned_docs/version-3.3.x/cookbooks-compaction.md
@@ -125,3 +125,31 @@ compactedTopicProducer.newMessage()
.value(someByteArray)
.send();
```
+
+## Remove compaction from a topic
+
+Since versions `2.11.4`, `3.0.3`, and `3.1.0` (with [PR
21745](https://github.com/apache/pulsar/pull/21745)), you can remove compaction
by removing the `__compaction` subscription.
+
+```shell
+bin/pulsar-admin topics unsubscribe {topic} -s __compaction
+```
+
+Before versions `2.11.4`, `3.0.3`, and `3.1.0`, if you wanted to remove
compaction from a topic, you needed access to the BookKeeper shell to remove
the compaction data. The steps are:
+
+1. Get the compacted ledgerId from the compactedLedger of stats-internal
+
+```shell
+bin/pulsar-admin topics stats-internal {topic}
+```
+
+2. Delete the compacted ledger
+
+```shell
+bin/bookkeeper shell deleteledger {compacted_ledger}
+```
+
+3. Unload the topic to clear the cache on the broker
+
+```shell
+bin/pulsar-admin topics unload {topic}
+```
diff --git a/versioned_docs/version-4.0.x/cookbooks-compaction.md
b/versioned_docs/version-4.0.x/cookbooks-compaction.md
index 8de0929a08ed..62cbc4d9c58c 100644
--- a/versioned_docs/version-4.0.x/cookbooks-compaction.md
+++ b/versioned_docs/version-4.0.x/cookbooks-compaction.md
@@ -125,3 +125,31 @@ compactedTopicProducer.newMessage()
.value(someByteArray)
.send();
```
+
+## Remove compaction from a topic
+
+Since versions `2.11.4`, `3.0.3`, and `3.1.0` (with [PR
21745](https://github.com/apache/pulsar/pull/21745)), you can remove compaction
by removing the `__compaction` subscription.
+
+```shell
+bin/pulsar-admin topics unsubscribe {topic} -s __compaction
+```
+
+Before versions `2.11.4`, `3.0.3`, and `3.1.0`, if you wanted to remove
compaction from a topic, you needed access to the BookKeeper shell to remove
the compaction data. The steps are:
+
+1. Get the compacted ledgerId from the compactedLedger of stats-internal
+
+```shell
+bin/pulsar-admin topics stats-internal {topic}
+```
+
+2. Delete the compacted ledger
+
+```shell
+bin/bookkeeper shell deleteledger {compacted_ledger}
+```
+
+3. Unload the topic to clear the cache on the broker
+
+```shell
+bin/pulsar-admin topics unload {topic}
+```