Skip to content

Check a Pulsar 4.0 to 5.0 migration

Same topics and functions on 4.0 and 5.0. What does moving mean?

Terminal recording of kurkik pulsar migrate-diff

The recording shows kurkik pulsar migrate-diff on the demo sandbox; its data differs from this example.

Terminal window
kurkik pulsar migrate-diff four five
four (Pulsar 4.0) vs five (Pulsar 5.0)
Migrations - server
manual replaced broker sslFactoryPluginParams -> tlsFactoryConfig - The parameters of the new factory, a JSON object or key=value list: carry them over by hand once the factory class is ported. (four: verify=true)
Defaults moved - server (24)
broker acknowledgmentAtBatchIndexLevelEnabled: false -> true
broker bookkeeperClientSeparatedIoThreadsEnabled: false -> true
broker defaultNumberOfNamespaceBundles: 4 -> 32
broker dispatcherMaxReadBatchSize: 100 -> 500
broker internalListenerName: null -> internal
broker keySharedLookAheadMsgInReplayThresholdPerConsumer: 2000 -> 4000
broker keySharedLookAheadMsgInReplayThresholdPerSubscription: 20000 -> 40000
broker loadBalancerDistributeBundlesEvenlyEnabled: true -> false
broker loadBalancerLoadPlacementStrategy: org.apache.pulsar.broker.loadbalance.impl.LeastLongTermMessageRate -> org.apache.pulsar.broker.loadbalance.impl.AvgShedder
broker loadBalancerLoadSheddingStrategy: org.apache.pulsar.broker.loadbalance.impl.ThresholdShedder -> org.apache.pulsar.broker.loadbalance.impl.AvgShedder
broker managedCursorInfoCompressionType: NONE -> LZ4
broker managedLedgerInfoCompressionType: NONE -> LZ4
broker managedLedgerMaxBatchDeletedIndexToPersist: 10000 -> 200000
broker managedLedgerMaxReadsInFlightSizeInMB: 0 -> null
broker managedLedgerMaxUnackedRangesToPersist: 10000 -> 200000
broker managedLedgerMaxUnackedRangesToPersistInMetadataStore: 1000 -> 200000
broker managedLedgerPersistIndividualAckAsLongArray: false -> true
broker maxUnloadPercentage: 0.2 -> 0.5
broker schemaRegistryCompatibilityCheckers: [org.apache.pulsar.broker.service.schema.ProtobufNativeSchemaCompatibilityCheck, org.apache.pulsar.broker.service.schema.JsonSchemaCompatibilityCheck, org.apache.pulsar.broker.service.schema.AvroSchemaCompatibilityCheck] -> [org.apache.pulsar.broker.service.schema.ExternalSchemaCompatibilityCheck, org.apache.pulsar.broker.service.schema.ProtobufNativeSchemaCompatibilityCheck, org.apache.pulsar.broker.service.schema.JsonSchemaCompatibilityCheck, org.apache.pulsar.broker.service.schema.AvroSchemaCompatibilityCheck]
broker tlsHostnameVerificationEnabled: false -> true
broker transactionBufferProviderClassName: org.apache.pulsar.broker.transaction.buffer.impl.TopicTransactionBufferProvider -> org.apache.pulsar.broker.transaction.buffer.impl.DispatchingTransactionBufferProvider
broker transactionPendingAckStoreProviderClassName: org.apache.pulsar.broker.transaction.pendingack.impl.MLPendingAckStoreProvider -> org.apache.pulsar.broker.transaction.pendingack.impl.DispatchingTransactionPendingAckStoreProvider
broker webServiceTlsProvider: Conscrypt -> none
client tlsHostnameVerificationEnable: false -> true
Defaults moved - operation (1)
consumer cryptoFailureAction: FAIL -> null
Notes
- Not compared: ACLs, consumers. Add --acls --consumers to compare them too.
- Four runs the Pulsar 4.0 line and Five the 5.0 line: settings are compared through both lines' catalogs (4.0 from 4.0.14, 5.0 from 5.0.0) and the settings each renamed, retyped, replaced or dropped.
Drift: 0 changed · 0 unmanaged · 0 missing · 0 re-check (no drift) - 58 matched · 1 migration(s), 1 manual · 25 default(s) moved
exit 0

Exit code 0: no drift.

Mark Means
~ both sides have it, but it differs
! only the first side has it
+ only the second side has it
Compare Command Result
two clusters kurkik pulsar migrate-diff four five Drift: 0 changed · 0 unmanaged · 0 missing · 0 re-check (no drift) - 58 matched · 1 migration(s), 1 manual · 25 default(s) moved
a document and a cluster kurkik pulsar migrate-diff four.yaml five Drift: 0 changed · 0 unmanaged · 0 missing · 0 re-check (no drift) - 58 matched · 1 migration(s), 1 manual · 25 default(s) moved
two documents kurkik pulsar migrate-diff four.yaml five.yaml Drift: 0 changed · 0 unmanaged · 0 missing · 0 re-check (no drift) - 58 matched · 1 migration(s), 1 manual · 25 default(s) moved

Download the JSON report (-o json)

four.yaml, 293 lines
asyncapi: 3.0.0
info:
title: four Apache Pulsar API
version: 1.0.0-SNAPSHOT
description: Generated by reading Apache Pulsar of four (http://pulsar-four:8080).
servers:
standalone:
host: pulsar-four:6650
protocol: pulsar
protocolVersion: "4.0"
description: Apache Pulsar cluster standalone.
bindings:
pulsar:
bindingVersion: 0.1.0
tenant: shop
x-kurkik:
pulsar:
server:
cluster: standalone
brokers:
- localhost:8080
schemaRegistryUrl: http://pulsar-four:8080
schemaRegistryVendor: pulsar
namespacePolicies:
public/default:
schema-autoupdate: "on"
shop/orders:
schema-autoupdate: "on"
tenants:
- tenant: public
adminRoles: []
allowedClusters:
- standalone
- tenant: shop
adminRoles:
- shop-admin
allowedClusters:
- standalone
security:
- security: NONE
tls: false
acl: []
consumers:
- subscription: enrich
type: Shared
topics:
- persistent://shop/orders/created
processor: function shop/orders/enrich
producers: []
functions:
- tenant: shop
namespace: orders
name: enrich
runtime: JAVA
className: com.github.pakisan.kurkik.pulsar.fixtures.Enrich
inputs:
- persistent://shop/orders/created
output: persistent://shop/orders/enriched
subscriptionName: enrich
parallelism: 1
processingGuarantees: ATLEAST_ONCE
channels:
- $ref: "#/channels/persistent-shop-orders-created"
- $ref: "#/channels/persistent-shop-orders-enriched"
roles: []
sources: []
sinks: []
brokerConfiguration:
advertisedAddress: localhost
backlogQuotaDefaultLimitGB: "10.0"
bookkeeperClientMinNumRacksPerWriteQuorum: "1"
bookkeeperClientReorderReadSequenceEnabled: "false"
bookkeeperNumberOfChannelsPerBookie: "1"
clusterName: standalone
enablePackagesManagement: "true"
forceDeleteNamespaceAllowed: "true"
functionsWorkerEnablePackageManagement: "true"
isRunningStandalone: "true"
loadBalancerEnabled: "false"
loadManagerClassName: org.apache.pulsar.broker.loadbalance.NoopLoadManager
managedLedgerCacheEvictionFrequency: "100.0"
managedLedgerDefaultAckQuorum: "1"
managedLedgerDefaultEnsembleSize: "1"
managedLedgerDefaultMarkDeleteRateLimit: "0.1"
managedLedgerDefaultWriteQuorum: "1"
metadataStoreUrl: rocksdb:///pulsar/data/metadata
packagesManagementStorageProvider: org.apache.pulsar.packages.management.storage.filesystem.FileSystemPackagesStorageProvider
sslFactoryPluginParams: verify=true
statusFilePath: /usr/local/apache/htdocs
topicPublisherThrottlingTickTimeMillis: "2"
webSocketServiceEnabled: "true"
clientConfiguration:
serviceUrl: pulsar://pulsar-four:6650
webServiceUrl: http://pulsar-four:8080
producerConfiguration: {}
consumerConfiguration: {}
channels:
persistent-shop-orders-created:
address: persistent://shop/orders/created
messages:
persistent-shop-orders-created:
payload:
type: string
name: persistent-shop-orders-created
title: persistent://shop/orders/created
summary: "Schema read from Pulsar's own registry: STRING, version 0."
x-kurkik:
pulsar:
message:
schemaType: STRING
schemaVersion: 0
schemaIdLocation: metadata
schemaLookupStrategy: topic
schemaCompatibility: FULL
key:
type: string
bindings:
pulsar:
bindingVersion: 0.1.0
namespace: orders
persistence: persistent
x-kurkik:
pulsar:
channel:
topic: persistent://shop/orders/created
tenant: shop
namespace: orders
persistence: persistent
partitions: 0
geo-replication:
- standalone
topicConfiguration:
partitions: 0
persistence: persistent
replication-clusters:
- standalone
schema-autoupdate: "on"
persistent-shop-orders-enriched:
address: persistent://shop/orders/enriched
messages:
persistent-shop-orders-enriched:
payload:
type: string
name: persistent-shop-orders-enriched
title: persistent://shop/orders/enriched
summary: "Schema read from Pulsar's own registry: STRING, version 0."
x-kurkik:
pulsar:
message:
schemaType: STRING
schemaVersion: 0
schemaIdLocation: metadata
schemaLookupStrategy: topic
schemaCompatibility: FULL
key:
type: string
bindings:
pulsar:
bindingVersion: 0.1.0
namespace: orders
persistence: persistent
x-kurkik:
pulsar:
channel:
topic: persistent://shop/orders/enriched
tenant: shop
namespace: orders
persistence: persistent
partitions: 0
geo-replication:
- standalone
topicConfiguration:
partitions: 0
persistence: persistent
replication-clusters:
- standalone
schema-autoupdate: "on"
persistent-shop-orders-paid:
address: persistent://shop/orders/paid
messages:
persistent-shop-orders-paid:
payload:
schemaFormat: application/vnd.apache.avro;version=1.9.0
schema:
type: record
name: Payment
namespace: shop
fields:
- name: order
type: string
- name: paid
type: boolean
name: persistent-shop-orders-paid
title: persistent://shop/orders/paid
summary: "Schema read from Pulsar's own registry: AVRO, version 0."
x-kurkik:
pulsar:
message:
schemaType: AVRO
schemaVersion: 0
schemaIdLocation: metadata
schemaLookupStrategy: topic
schemaCompatibility: FULL
key:
type: string
bindings:
pulsar:
bindingVersion: 0.1.0
namespace: orders
persistence: persistent
x-kurkik:
pulsar:
channel:
topic: persistent://shop/orders/paid
tenant: shop
namespace: orders
persistence: persistent
partitions: 2
geo-replication:
- standalone
topicConfiguration:
partitions: 2
persistence: persistent
replication-clusters:
- standalone
schema-autoupdate: "on"
operations:
receive_persistent-shop-orders-created:
action: receive
channel:
$ref: "#/channels/persistent-shop-orders-created"
x-kurkik:
pulsar:
operation:
groupId:
type: string
enum:
- enrich
security: []
processors:
- type: function
name: shop/orders/enrich
server: standalone
consumerConfiguration: {}
receive_persistent-shop-orders-enriched:
action: receive
channel:
$ref: "#/channels/persistent-shop-orders-enriched"
x-kurkik:
pulsar:
operation:
security: []
consumerConfiguration: {}
receive_persistent-shop-orders-paid:
action: receive
channel:
$ref: "#/channels/persistent-shop-orders-paid"
x-kurkik:
pulsar:
operation:
security: []
consumerConfiguration: {}
send_persistent-shop-orders-created:
action: send
channel:
$ref: "#/channels/persistent-shop-orders-created"
x-kurkik:
pulsar:
operation:
security: []
producerConfiguration: {}
send_persistent-shop-orders-enriched:
action: send
channel:
$ref: "#/channels/persistent-shop-orders-enriched"
x-kurkik:
pulsar:
operation:
security: []
processors:
- type: function
name: shop/orders/enrich
server: standalone
producerConfiguration: {}
send_persistent-shop-orders-paid:
action: send
channel:
$ref: "#/channels/persistent-shop-orders-paid"
x-kurkik:
pulsar:
operation:
security: []
producerConfiguration: {}

Download four.yaml

five.yaml, 292 lines
asyncapi: 3.0.0
info:
title: five Apache Pulsar API
version: 1.0.0-SNAPSHOT
description: Generated by reading Apache Pulsar of five (http://pulsar-five:8080).
servers:
standalone:
host: pulsar-five:6650
protocol: pulsar
protocolVersion: "5.0"
description: Apache Pulsar cluster standalone.
bindings:
pulsar:
bindingVersion: 0.1.0
tenant: shop
x-kurkik:
pulsar:
server:
cluster: standalone
brokers:
- localhost:8080
schemaRegistryUrl: http://pulsar-five:8080
schemaRegistryVendor: pulsar
namespacePolicies:
public/default:
schema-autoupdate: "on"
shop/orders:
schema-autoupdate: "on"
tenants:
- tenant: public
adminRoles: []
allowedClusters:
- standalone
- tenant: shop
adminRoles:
- shop-admin
allowedClusters:
- standalone
security:
- security: NONE
tls: false
acl: []
consumers:
- subscription: enrich
type: Shared
topics:
- persistent://shop/orders/created
processor: function shop/orders/enrich
producers: []
functions:
- tenant: shop
namespace: orders
name: enrich
runtime: JAVA
className: com.github.pakisan.kurkik.pulsar.fixtures.Enrich
inputs:
- persistent://shop/orders/created
output: persistent://shop/orders/enriched
subscriptionName: enrich
parallelism: 1
processingGuarantees: ATLEAST_ONCE
channels:
- $ref: "#/channels/persistent-shop-orders-created"
- $ref: "#/channels/persistent-shop-orders-enriched"
roles: []
sources: []
sinks: []
brokerConfiguration:
advertisedAddress: localhost
backlogQuotaDefaultLimitGB: "10.0"
bookkeeperClientMinNumRacksPerWriteQuorum: "1"
bookkeeperClientReorderReadSequenceEnabled: "false"
bookkeeperNumberOfChannelsPerBookie: "1"
clusterName: standalone
enablePackagesManagement: "true"
forceDeleteNamespaceAllowed: "true"
functionsWorkerEnablePackageManagement: "true"
isRunningStandalone: "true"
loadBalancerEnabled: "false"
loadManagerClassName: org.apache.pulsar.broker.loadbalance.NoopLoadManager
managedLedgerCacheEvictionFrequency: "100.0"
managedLedgerDefaultAckQuorum: "1"
managedLedgerDefaultEnsembleSize: "1"
managedLedgerDefaultMarkDeleteRateLimit: "0.1"
managedLedgerDefaultWriteQuorum: "1"
metadataStoreUrl: rocksdb:///pulsar/data/metadata
packagesManagementStorageProvider: org.apache.pulsar.packages.management.storage.filesystem.FileSystemPackagesStorageProvider
statusFilePath: /usr/local/apache/htdocs
topicPublisherThrottlingTickTimeMillis: "2"
webSocketServiceEnabled: "true"
clientConfiguration:
serviceUrl: pulsar://pulsar-five:6650
webServiceUrl: http://pulsar-five:8080
producerConfiguration: {}
consumerConfiguration: {}
channels:
persistent-shop-orders-created:
address: persistent://shop/orders/created
messages:
persistent-shop-orders-created:
payload:
type: string
name: persistent-shop-orders-created
title: persistent://shop/orders/created
summary: "Schema read from Pulsar's own registry: STRING, version 0."
x-kurkik:
pulsar:
message:
schemaType: STRING
schemaVersion: 0
schemaIdLocation: metadata
schemaLookupStrategy: topic
schemaCompatibility: FULL
key:
type: string
bindings:
pulsar:
bindingVersion: 0.1.0
namespace: orders
persistence: persistent
x-kurkik:
pulsar:
channel:
topic: persistent://shop/orders/created
tenant: shop
namespace: orders
persistence: persistent
partitions: 0
geo-replication:
- standalone
topicConfiguration:
partitions: 0
persistence: persistent
replication-clusters:
- standalone
schema-autoupdate: "on"
persistent-shop-orders-enriched:
address: persistent://shop/orders/enriched
messages:
persistent-shop-orders-enriched:
payload:
type: string
name: persistent-shop-orders-enriched
title: persistent://shop/orders/enriched
summary: "Schema read from Pulsar's own registry: STRING, version 0."
x-kurkik:
pulsar:
message:
schemaType: STRING
schemaVersion: 0
schemaIdLocation: metadata
schemaLookupStrategy: topic
schemaCompatibility: FULL
key:
type: string
bindings:
pulsar:
bindingVersion: 0.1.0
namespace: orders
persistence: persistent
x-kurkik:
pulsar:
channel:
topic: persistent://shop/orders/enriched
tenant: shop
namespace: orders
persistence: persistent
partitions: 0
geo-replication:
- standalone
topicConfiguration:
partitions: 0
persistence: persistent
replication-clusters:
- standalone
schema-autoupdate: "on"
persistent-shop-orders-paid:
address: persistent://shop/orders/paid
messages:
persistent-shop-orders-paid:
payload:
schemaFormat: application/vnd.apache.avro;version=1.9.0
schema:
type: record
name: Payment
namespace: shop
fields:
- name: order
type: string
- name: paid
type: boolean
name: persistent-shop-orders-paid
title: persistent://shop/orders/paid
summary: "Schema read from Pulsar's own registry: AVRO, version 0."
x-kurkik:
pulsar:
message:
schemaType: AVRO
schemaVersion: 0
schemaIdLocation: metadata
schemaLookupStrategy: topic
schemaCompatibility: FULL
key:
type: string
bindings:
pulsar:
bindingVersion: 0.1.0
namespace: orders
persistence: persistent
x-kurkik:
pulsar:
channel:
topic: persistent://shop/orders/paid
tenant: shop
namespace: orders
persistence: persistent
partitions: 2
geo-replication:
- standalone
topicConfiguration:
partitions: 2
persistence: persistent
replication-clusters:
- standalone
schema-autoupdate: "on"
operations:
receive_persistent-shop-orders-created:
action: receive
channel:
$ref: "#/channels/persistent-shop-orders-created"
x-kurkik:
pulsar:
operation:
groupId:
type: string
enum:
- enrich
security: []
processors:
- type: function
name: shop/orders/enrich
server: standalone
consumerConfiguration: {}
receive_persistent-shop-orders-enriched:
action: receive
channel:
$ref: "#/channels/persistent-shop-orders-enriched"
x-kurkik:
pulsar:
operation:
security: []
consumerConfiguration: {}
receive_persistent-shop-orders-paid:
action: receive
channel:
$ref: "#/channels/persistent-shop-orders-paid"
x-kurkik:
pulsar:
operation:
security: []
consumerConfiguration: {}
send_persistent-shop-orders-created:
action: send
channel:
$ref: "#/channels/persistent-shop-orders-created"
x-kurkik:
pulsar:
operation:
security: []
producerConfiguration: {}
send_persistent-shop-orders-enriched:
action: send
channel:
$ref: "#/channels/persistent-shop-orders-enriched"
x-kurkik:
pulsar:
operation:
security: []
processors:
- type: function
name: shop/orders/enrich
server: standalone
producerConfiguration: {}
send_persistent-shop-orders-paid:
action: send
channel:
$ref: "#/channels/persistent-shop-orders-paid"
x-kurkik:
pulsar:
operation:
security: []
producerConfiguration: {}

Download five.yaml

How to build this setup yourself

Clusters

Fixture

Terminal window
pulsar-admin tenants create shop --allowed-clusters standalone --admin-roles shop-admin
pulsar-admin namespaces create shop/orders --clusters standalone
pulsar-admin topics create persistent://shop/orders/created
pulsar-admin topics create-partitioned-topic persistent://shop/orders/paid --partitions 2

Side four

Terminal window
pulsar-admin --admin-url http://pulsar-four:8080 schemas upload persistent://shop/orders/paid -f schema.json # {"type": "AVRO", "schema": "{\"type\":\"record\",\"name\":\"Payment\",\"namespace\":\"shop\",\"fields\":[{\"name\":\"order\",\"type\":\"string\"},{\"name\":\"paid\",\"type\":\"boolean\"}]}"}
pulsar-admin --admin-url http://pulsar-four:8080 packages upload function://shop/orders/enrich@0 --path kurkik-pulsar-processors.jar --description 'kurkik fixtures'
pulsar-admin --admin-url http://pulsar-four:8080 functions create --tenant shop --namespace orders --name enrich --jar function://shop/orders/enrich@0 --classname com.github.pakisan.kurkik.pulsar.fixtures.Enrich --inputs persistent://shop/orders/created --output persistent://shop/orders/enriched --subs-name enrich --parallelism 1

Side five

Terminal window
pulsar-admin --admin-url http://pulsar-five:8080 schemas upload persistent://shop/orders/paid -f schema.json # {"type": "AVRO", "schema": "{\"type\":\"record\",\"name\":\"Payment\",\"namespace\":\"shop\",\"fields\":[{\"name\":\"order\",\"type\":\"string\"},{\"name\":\"paid\",\"type\":\"boolean\"}]}"}
pulsar-admin --admin-url http://pulsar-five:8080 packages upload function://shop/orders/enrich@0 --path kurkik-pulsar-processors.jar --description 'kurkik fixtures'
pulsar-admin --admin-url http://pulsar-five:8080 functions create --tenant shop --namespace orders --name enrich --jar function://shop/orders/enrich@0 --classname com.github.pakisan.kurkik.pulsar.fixtures.Enrich --inputs persistent://shop/orders/created --output persistent://shop/orders/enriched --subs-name enrich --parallelism 1

Compare

Terminal window
kurkik conn add pulsar four --admin-url http://pulsar-four:8080 --service-url pulsar://pulsar-four:6650 --client 4.0
kurkik conn add pulsar five --admin-url http://pulsar-five:8080 --service-url pulsar://pulsar-five:6650 --client 5.0
kurkik pulsar export four --this-cluster-only --acls --consumers --stdout > four.yaml
kurkik pulsar export five --this-cluster-only --acls --consumers --stdout > five.yaml
kurkik pulsar migrate-diff four five # cluster-vs-cluster
kurkik pulsar migrate-diff four.yaml five # document-vs-cluster
kurkik pulsar migrate-diff four.yaml five.yaml # document-vs-document

All flags: kurkik pulsar migrate-diff · more Apache Pulsar migrate-diff examples