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

[improve][pip] PIP-400: Support namespace-level configuration of migratedClusterUrl in blue-green migration feature #23790

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
97 changes: 97 additions & 0 deletions pip/pip-400.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
# PIP-400: Support namespace-level configuration of migratedClusterUrl in blue-green migration feature

# Background knowledge

The blue-green cluster migration feature supports migrating topic traffic from one cluster to another.
Currently, the migration feature can be enabled at both the cluster and namespace levels,
and the target migration cluster information can be configured at the cluster level.

# Motivation

However, there are times when we want to migrate different namespaces to different clusters.
For example, a certain namespace belongs to a specific business and is currently in a public cluster.
We want to migrate this namespace to a dedicated cluster for that business.
Therefore, we would like to support configuring the target migration cluster information at the namespace level.

# Goals

## In Scope

Support configuring target migration cluster information at the namespace level,
allowing different namespaces to be migrated to different clusters.

## Out of Scope

# High Level Design

Allow configuring target migration cluster information at the namespace level,
with this configuration having a higher priority than cluster-level configuration.

# Detailed Design

## Design & Implementation Details

- Add a property of type `ClusterUrl` named `migratedClusterUrl` in the `localPolicies` of namespace. This configuration should have a higher priority than the cluster-level configuration.
- Add or modify the public API and CLI to support updating the value of `migratedClusterUrl`.

## Public-facing Changes

### Public API
Add a new API:
```java
/**
* Update migration state for a namespace.
* @param namespace
* Namespace name
* @param migrated
* Flag to determine namespace is migrated or not
* @param clusterUrl
* Cluster url data
* @throws NotAuthorizedException
* Don't have admin permission
* @throws NotFoundException
* Namespace does not exist
* @throws PulsarAdminException
* Unexpected error
*/
void updateMigrationState(String namespace, boolean migrated, ClusterUrl clusterUrl) throws PulsarAdminException;

/**
* Update migration state for a namespace asynchronously.
*/
CompletableFuture<Void> updateMigrationStateAsync(String namespace, boolean migrated, ClusterUrl clusterUrl);
```

### Binary protocol

### Configuration

### CLI
Modify the `update-migration-state` command to add an option for configuring the `ClusterUrl` information.
```shell
update-migration-state --migrated --service-url serviceUrl --service-url-secure serviceUrlTls --broker-url brokerServiceUrl --broker-url-secure brokerServiceUrlTls tenant/namespace
```

### Metrics

# Monitoring

# Security Considerations
Only superuser can access the admin API.

# Backward & Forward Compatibility

## Upgrade

## Downgrade / Rollback

## Pulsar Geo-Replication Upgrade & Downgrade/Rollback Considerations

# Alternatives

# General Notes

# Links

* Mailing List discussion thread: https://lists.apache.org/thread/bq7g3916fvh5xskvkn6bnynfy8zmr5mo
* Mailing List voting thread:
Loading