Skip to content
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

[ISSUE 8159]Add a new state for namespace-level TTL #8178

Merged
merged 5 commits into from
Oct 2, 2020

Conversation

315157973
Copy link
Contributor

Fixes #8159

Motivation

When the namespace-level TTL is set to 0, it means 2 states:

  1. TTL check is disabled
  2. The namespace-level setting does not exist, return to the broker-level setting
    These two states are in conflict. We don't know if it is disabled or using broker-level configuration.

Modifications

We should set a state separately for the case where the namespace-level configuration does not exist.
The TTL of the namespace-level can be set to null, which means it does not exist. It is consistent with topic-level TTL.

Verifying this change

@315157973 315157973 changed the title support remove namespace-level ttl [ISSUE 8159]Add a new state for namespace-level TTL Oct 1, 2020
@315157973
Copy link
Contributor Author

/pulsarbot run-failure-checks

@315157973
Copy link
Contributor Author

/pulsarbot run-failure-checks

@sijie sijie merged commit aa7383e into apache:master Oct 2, 2020
lbenc135 pushed a commit to lbenc135/pulsar that referenced this pull request Oct 3, 2020
Fixes apache#8159 

### Motivation
When the namespace-level TTL is set to 0, it means 2 states:
1) TTL check is disabled 
2) The namespace-level setting does not exist, return to the broker-level setting
These two states are in conflict. We don't know if it is disabled or using broker-level configuration.

### Modifications
We should set a state separately for the case where the namespace-level configuration does not exist.
The TTL of the namespace-level can be set to null, which means it does not exist. It is consistent with topic-level TTL.

### Verifying this change
codelipenghui pushed a commit that referenced this pull request Oct 7, 2020
Fixes #8159

When the namespace-level TTL is set to 0, it means 2 states:
1) TTL check is disabled
2) The namespace-level setting does not exist, return to the broker-level setting
These two states are in conflict. We don't know if it is disabled or using broker-level configuration.

We should set a state separately for the case where the namespace-level configuration does not exist.
The TTL of the namespace-level can be set to null, which means it does not exist. It is consistent with topic-level TTL.

(cherry picked from commit aa7383e)
@codelipenghui
Copy link
Contributor

This PR has cherry-picked to branch-2.6.

wolfstudy added a commit that referenced this pull request Oct 30, 2020
wolfstudy pushed a commit that referenced this pull request Oct 30, 2020
Fixes #8159

When the namespace-level TTL is set to 0, it means 2 states:
1) TTL check is disabled
2) The namespace-level setting does not exist, return to the broker-level setting
These two states are in conflict. We don't know if it is disabled or using broker-level configuration.

We should set a state separately for the case where the namespace-level configuration does not exist.
The TTL of the namespace-level can be set to null, which means it does not exist. It is consistent with topic-level TTL.

(cherry picked from commit aa7383e)
(cherry picked from commit e2973f6)
huangdx0726 pushed a commit to huangdx0726/pulsar that referenced this pull request Nov 13, 2020
Fixes apache#8159 

### Motivation
When the namespace-level TTL is set to 0, it means 2 states:
1) TTL check is disabled 
2) The namespace-level setting does not exist, return to the broker-level setting
These two states are in conflict. We don't know if it is disabled or using broker-level configuration.

### Modifications
We should set a state separately for the case where the namespace-level configuration does not exist.
The TTL of the namespace-level can be set to null, which means it does not exist. It is consistent with topic-level TTL.

### Verifying this change
@315157973 315157973 deleted the ttl-8159 branch November 28, 2020 03:06
codelipenghui pushed a commit that referenced this pull request Jul 9, 2021
### Motivation

If the subscription expiration time is set to a value greater than 0 at the broker level, setting 0 at the namespace level will not disable automatic subscription deletion.

For example, suppose `subscriptionExpirationTimeMinutes=5` is written in `broker.conf`. This means that subscriptions to which no consumer is connected will be automatically deleted in 5 minutes.

Now, suppose a user runs the following command to disable automatic subscription deletion in the namespace `tenant/ns`.

```sh
$ ./bin/pulsar-admin namespaces set-subscription-expiration-time -t 0 tenant/ns
```

However, subscriptions in namespace `tenant/ns` will actually be deleted in 5 minutes like any other namespace.

### Modifications

Change the type of `subscription_expiration_time_minutes` in the namespace policies from `int` to `java.lang.Integer` so that it can be set to null.

If `subscription_expiration_time_minutes` is 0, automatic subscription deletion is disabled. If it is null, the broker-level setting is used.

This fix is similar to #8178.
codelipenghui pushed a commit that referenced this pull request Jul 14, 2021
### Motivation

If the subscription expiration time is set to a value greater than 0 at the broker level, setting 0 at the namespace level will not disable automatic subscription deletion.

For example, suppose `subscriptionExpirationTimeMinutes=5` is written in `broker.conf`. This means that subscriptions to which no consumer is connected will be automatically deleted in 5 minutes.

Now, suppose a user runs the following command to disable automatic subscription deletion in the namespace `tenant/ns`.

```sh
$ ./bin/pulsar-admin namespaces set-subscription-expiration-time -t 0 tenant/ns
```

However, subscriptions in namespace `tenant/ns` will actually be deleted in 5 minutes like any other namespace.

### Modifications

Change the type of `subscription_expiration_time_minutes` in the namespace policies from `int` to `java.lang.Integer` so that it can be set to null.

If `subscription_expiration_time_minutes` is 0, automatic subscription deletion is disabled. If it is null, the broker-level setting is used.

This fix is similar to #8178.

(cherry picked from commit 406ef73)
bharanic-dev pushed a commit to bharanic-dev/pulsar that referenced this pull request Mar 18, 2022
### Motivation

If the subscription expiration time is set to a value greater than 0 at the broker level, setting 0 at the namespace level will not disable automatic subscription deletion.

For example, suppose `subscriptionExpirationTimeMinutes=5` is written in `broker.conf`. This means that subscriptions to which no consumer is connected will be automatically deleted in 5 minutes.

Now, suppose a user runs the following command to disable automatic subscription deletion in the namespace `tenant/ns`.

```sh
$ ./bin/pulsar-admin namespaces set-subscription-expiration-time -t 0 tenant/ns
```

However, subscriptions in namespace `tenant/ns` will actually be deleted in 5 minutes like any other namespace.

### Modifications

Change the type of `subscription_expiration_time_minutes` in the namespace policies from `int` to `java.lang.Integer` so that it can be set to null.

If `subscription_expiration_time_minutes` is 0, automatic subscription deletion is disabled. If it is null, the broker-level setting is used.

This fix is similar to apache#8178.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Disable namespace ttl while enable broker level ttl
3 participants