diff --git a/pip/pip-400.md b/pip/pip-400.md new file mode 100644 index 0000000000000..703127f662bb3 --- /dev/null +++ b/pip/pip-400.md @@ -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 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: