Skip to content

Commit

Permalink
[improve][pip] PIP-399: Support namespace-level configuration of migr…
Browse files Browse the repository at this point in the history
…atedClusterUrl in blue-green migration feature
  • Loading branch information
ruihongzhou committed Dec 27, 2024
1 parent 1967a93 commit 0c01519
Showing 1 changed file with 94 additions and 0 deletions.
94 changes: 94 additions & 0 deletions pip/pip-399.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
# PIP-399: 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.

### 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:
* Mailing List voting thread:

0 comments on commit 0c01519

Please sign in to comment.