From 0c015195216cb20dc4830abc2fc6711bda3a07a3 Mon Sep 17 00:00:00 2001 From: ruihongzhou Date: Fri, 27 Dec 2024 18:06:09 +0800 Subject: [PATCH 1/3] [improve][pip] PIP-399: Support namespace-level configuration of migratedClusterUrl in blue-green migration feature --- pip/pip-399.md | 94 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 94 insertions(+) create mode 100644 pip/pip-399.md diff --git a/pip/pip-399.md b/pip/pip-399.md new file mode 100644 index 0000000000000..0483929d2179b --- /dev/null +++ b/pip/pip-399.md @@ -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 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: From 51230946947cccb712b61afeeefd919980f003a9 Mon Sep 17 00:00:00 2001 From: ruihongzhou Date: Fri, 27 Dec 2024 18:29:16 +0800 Subject: [PATCH 2/3] update --- pip/pip-399.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pip/pip-399.md b/pip/pip-399.md index 0483929d2179b..ff33907d4b67d 100644 --- a/pip/pip-399.md +++ b/pip/pip-399.md @@ -90,5 +90,5 @@ Only superuser can access the admin API. # Links -* Mailing List discussion thread: +* Mailing List discussion thread: https://lists.apache.org/thread/bq7g3916fvh5xskvkn6bnynfy8zmr5mo * Mailing List voting thread: From a4185e6f527b5948bcd3526f56f5c706fe184462 Mon Sep 17 00:00:00 2001 From: ruihongzhou Date: Fri, 27 Dec 2024 18:32:54 +0800 Subject: [PATCH 3/3] [improve][pip] PIP-400: Support namespace-level configuration of migratedClusterUrl in blue-green migration feature --- pip/{pip-399.md => pip-400.md} | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) rename pip/{pip-399.md => pip-400.md} (91%) diff --git a/pip/pip-399.md b/pip/pip-400.md similarity index 91% rename from pip/pip-399.md rename to pip/pip-400.md index ff33907d4b67d..703127f662bb3 100644 --- a/pip/pip-399.md +++ b/pip/pip-400.md @@ -1,4 +1,4 @@ -# PIP-399: Support namespace-level configuration of migratedClusterUrl in blue-green migration feature +# PIP-400: Support namespace-level configuration of migratedClusterUrl in blue-green migration feature # Background knowledge @@ -68,6 +68,9 @@ Add a new API: ### 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