Skip to content

[pulsar-admin] Support delete schema ledgers when delete topics #8167

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Sep 30, 2020

Conversation

BewareMyPower
Copy link
Contributor

@BewareMyPower BewareMyPower commented Sep 30, 2020

Master Issue: #8134

Motivation

The REST APIs of PersistentTopics#deleteTopic and PersistentTopics#deletePartitionedTopic didn't support delete schema of topics, which may cause after topics were deleted, the schema ledgers still existed. And current implementation of delete schema is just add a empty schema ledger but not delete existed schema ledgers.

Modifications

  • Add a deleteSchema query param to REST APIs of deleting topics/partitioned topics;
  • Add a map to record the created ledgers in BookkeeperSchemaStorage;
  • Expose deleteSchema param in pulsar-admin APIs;
  • Delete schema ledgers when delete the cluster with -a option.

Verifying this change

  • Make sure that the change passes the CI checks.

It has been tested in local environments:

  1. Check the current count of ledgers;
  2. Create a new partitioned topic or non-partitioned topic;
  3. Create producers/consumers with schema to send and receive messages with the created topic;
  4. Delete the topic with deleteSchema=true query param or call admin API that set deleteSchema to false;
  5. Recheck the count of ledgers, make sure it's the same with step 1.

Does this pull request potentially affect one of the following parts:

If yes was chosen, please highlight the changes

  • The rest endpoints: (yes)

Documentation

  • Does this pull request introduce a new feature? (yes)
  • If yes, how is the feature documented? (JavaDocs)

Sorry, something went wrong.

@BewareMyPower
Copy link
Contributor Author

/pulsarbot run-failure-checks

1 similar comment
@BewareMyPower
Copy link
Contributor Author

/pulsarbot run-failure-checks

@jiazhai jiazhai added area/admin doc-required Your PR changes impact docs and you will update later. labels Sep 30, 2020
@jiazhai jiazhai added this to the 2.7.0 milestone Sep 30, 2020
@jiazhai jiazhai merged commit 983266d into apache:master Sep 30, 2020
BewareMyPower added a commit to streamnative/pulsar-archived that referenced this pull request Oct 1, 2020
…he#8167)

Master Issue: apache#8134 

### Motivation

The REST APIs of `PersistentTopics#deleteTopic` and `PersistentTopics#deletePartitionedTopic` didn't support delete schema of topics, which may cause after topics were deleted, the schema ledgers still existed. And current implementation of delete schema is just add a empty schema ledger but not delete existed schema ledgers.

### Modifications

- Add a `deleteSchema` query param to REST APIs of deleting topics/partitioned topics;
- Add a map to record the created ledgers in `BookkeeperSchemaStorage`;
- Expose `deleteSchema` param in pulsar-admin APIs;
- Delete schema ledgers when delete the cluster with `-a` option.

### Verifying this change
It has been tested in local environments:
1. Check the current count of ledgers;
2. Create a new partitioned topic or non-partitioned topic;
3. Create producers/consumers with schema to send and receive messages with the created topic;
4. Delete the topic with `deleteSchema=true` query param or call admin API that set `deleteSchema` to false;
5. Recheck the count of ledgers, make sure it's the same with step 1.
BewareMyPower added a commit to streamnative/pulsar-archived that referenced this pull request Oct 1, 2020
…he#8167)

Master Issue: apache#8134 

### Motivation

The REST APIs of `PersistentTopics#deleteTopic` and `PersistentTopics#deletePartitionedTopic` didn't support delete schema of topics, which may cause after topics were deleted, the schema ledgers still existed. And current implementation of delete schema is just add a empty schema ledger but not delete existed schema ledgers.

### Modifications

- Add a `deleteSchema` query param to REST APIs of deleting topics/partitioned topics;
- Add a map to record the created ledgers in `BookkeeperSchemaStorage`;
- Expose `deleteSchema` param in pulsar-admin APIs;
- Delete schema ledgers when delete the cluster with `-a` option.

### Verifying this change
It has been tested in local environments:
1. Check the current count of ledgers;
2. Create a new partitioned topic or non-partitioned topic;
3. Create producers/consumers with schema to send and receive messages with the created topic;
4. Delete the topic with `deleteSchema=true` query param or call admin API that set `deleteSchema` to false;
5. Recheck the count of ledgers, make sure it's the same with step 1.
lbenc135 pushed a commit to lbenc135/pulsar that referenced this pull request Oct 3, 2020
…he#8167)

Master Issue: apache#8134 

### Motivation

The REST APIs of `PersistentTopics#deleteTopic` and `PersistentTopics#deletePartitionedTopic` didn't support delete schema of topics, which may cause after topics were deleted, the schema ledgers still existed. And current implementation of delete schema is just add a empty schema ledger but not delete existed schema ledgers.

### Modifications

- Add a `deleteSchema` query param to REST APIs of deleting topics/partitioned topics;
- Add a map to record the created ledgers in `BookkeeperSchemaStorage`;
- Expose `deleteSchema` param in pulsar-admin APIs;
- Delete schema ledgers when delete the cluster with `-a` option.

### Verifying this change
It has been tested in local environments:
1. Check the current count of ledgers;
2. Create a new partitioned topic or non-partitioned topic;
3. Create producers/consumers with schema to send and receive messages with the created topic;
4. Delete the topic with `deleteSchema=true` query param or call admin API that set `deleteSchema` to false;
5. Recheck the count of ledgers, make sure it's the same with step 1.
@wolfstudy
Copy link
Member

need to cherry-pick to 2.6.2.

wolfstudy pushed a commit that referenced this pull request Oct 30, 2020
Master Issue: #8134 

### Motivation

The REST APIs of `PersistentTopics#deleteTopic` and `PersistentTopics#deletePartitionedTopic` didn't support delete schema of topics, which may cause after topics were deleted, the schema ledgers still existed. And current implementation of delete schema is just add a empty schema ledger but not delete existed schema ledgers.

### Modifications

- Add a `deleteSchema` query param to REST APIs of deleting topics/partitioned topics;
- Add a map to record the created ledgers in `BookkeeperSchemaStorage`;
- Expose `deleteSchema` param in pulsar-admin APIs;
- Delete schema ledgers when delete the cluster with `-a` option.

### Verifying this change
It has been tested in local environments:
1. Check the current count of ledgers;
2. Create a new partitioned topic or non-partitioned topic;
3. Create producers/consumers with schema to send and receive messages with the created topic;
4. Delete the topic with `deleteSchema=true` query param or call admin API that set `deleteSchema` to false;
5. Recheck the count of ledgers, make sure it's the same with step 1.

(cherry picked from commit 983266d)
huangdx0726 pushed a commit to huangdx0726/pulsar that referenced this pull request Nov 13, 2020
…he#8167)

Master Issue: apache#8134 

### Motivation

The REST APIs of `PersistentTopics#deleteTopic` and `PersistentTopics#deletePartitionedTopic` didn't support delete schema of topics, which may cause after topics were deleted, the schema ledgers still existed. And current implementation of delete schema is just add a empty schema ledger but not delete existed schema ledgers.

### Modifications

- Add a `deleteSchema` query param to REST APIs of deleting topics/partitioned topics;
- Add a map to record the created ledgers in `BookkeeperSchemaStorage`;
- Expose `deleteSchema` param in pulsar-admin APIs;
- Delete schema ledgers when delete the cluster with `-a` option.

### Verifying this change
It has been tested in local environments:
1. Check the current count of ledgers;
2. Create a new partitioned topic or non-partitioned topic;
3. Create producers/consumers with schema to send and receive messages with the created topic;
4. Delete the topic with `deleteSchema=true` query param or call admin API that set `deleteSchema` to false;
5. Recheck the count of ledgers, make sure it's the same with step 1.
@BewareMyPower BewareMyPower deleted the bewaremypower/delete-schema-dev branch December 2, 2020 07:26
@Anonymitaet Anonymitaet removed the doc-required Your PR changes impact docs and you will update later. label Feb 21, 2022
@Anonymitaet Anonymitaet added the doc Your PR contains doc changes, no matter whether the changes are in markdown or code files. label Feb 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/admin doc Your PR contains doc changes, no matter whether the changes are in markdown or code files. release/2.6.2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants