Closed AdilHoumadi closed 3 years ago
@AdilHoumadi Thank you for catching this, this is a bug! What happened was there was a slight update in one of the API endpoints the 0.15 release (#6545), which we overlooked. This version of the migrations tool is compatible with versions 0.15+, but we will be patching this bug in the 0.20 release.
@jzaralim, Thanks for the feedback, looking forward to test it once released!
Worth mentioning you effectively have two ksqldb-cli images of different versions in the compose file
for the testing I took the official docker-compose from this repo: https://github.com/confluentinc/cp-all-in-one/
The confluentinc/cp-ksqldb-cli:6.1.1 does not contain the ksql-migrations
bin, this the reason of having this extra confluentinc/ksqldb-cli:0.17.0 (cli)
Sure, though, they should be interchangeable with cp-ksqldb-cli
trailing a few versions behind
This is fixed: https://github.com/confluentinc/ksql/pull/7667
We rolled out confluentinc/cp-*:6.1.1
before we realized a use case for ksql.
1) Does this mean I have to wait for confluentinc/cp-*:7.x.x
images to have ksql-migrations
working?
2a) What is the main problem (other than ksql-migration not being on the cp- images)? The `confluentinc/cp-:6.1.1` images are using ksql <0.15, but the non-cp cli's are using >=0.15?
2b) Does that mean I can use confluentinc/ksqldb-cli:0.14.x
and the migrations will work with 6.1.1?
Sorry, very confused with all the version renames between ksql and cp-ksql...it's not very friendly.
3) How do I find out which version of ksql
a certain cp-* image is using?!? The cp images show 6.1.1 when using ksql
command, while the non-cp cli images shows 0.17/0.18/etc.
3a) You say it will be fixed with 0.20, but git tag --contains 8f2d7994
only shows v7.0.0-x. Where does 0.20 come in?
With traditional database migrations, I would run the migrations at boot of my app server. That's not so good with scaling these days.
4) Is spinning up a cli container, running the migration, then shutting it down really the best way to do ksql migrations? (Is there a ksql-migration project? Probably better to ask there, if there is one.)
Hi @dailytabs,
ksql-migrations
should work. Otherwise, yes you will have to wait for 7.0.0
or the independent 0.20.0
ksqlDB release to use the migration tool with a 6.1.1
server.2a. The ksql-migrations
tool was released in 6.2.0
and are only compatible with 6.2.0
/0.15.0
and newer servers.
2b. No, the issue is with ksql-migrations
and the server versions. ksql-migrations
is not included in the 0.14.x
images.
ksql-migrations
tool might look like.I hope that helps!
@jzaralim Yes, that helped tremendously. We settled on upgrading to 6.2 and I was able to get it all running locally, today. Just need to finish debugging an issue with --define
and I should have a solid setup.
Thank you!
Describe the bug ksql-migrations is not compatible with Cloud Platform Docker image 6.1.1
To Reproduce Steps to reproduce the behavior, include:
docker-compose up -d
docker exec -it ksql-migrations bash
ksql-migrations new-project /share/migrations/ http://ksqldb-server:8088
Migrations metadata configs:
ksql.migrations.stream.name=MIGRATION_EVENTS
ksql.migrations.table.name=MIGRATION_SCHEMA_VERSIONS
ksql.migrations.stream.topic.name=ksql-service-idksql_MIGRATION_EVENTS
ksql.migrations.table.topic.name=ksql-service-idksql_MIGRATION_SCHEMA_VERSIONS
ksql.migrations.topic.replicas=1
TLS configs:
ssl.truststore.location=
ssl.truststore.password=
ssl.keystore.location=
ssl.keystore.password=
ssl.key.password=
ssl.key.alias=
ssl.alpn=false
ssl.verify.host=true
ksqlDB server authentication configs:
ksql.auth.basic.username=
ksql.auth.basic.password=
Migrations project directory created successfully Execution time: 0.0340 seconds
ksql-migrations --config-file /share/migrations/ksql-migrations.properties initialize-metadata OpenJDK 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in version 9.0 and will likely be removed in a future release. Initializing migrations metadata Creating stream: MIGRATION_EVENTS Creating table: MIGRATION_SCHEMA_VERSIONS Migrations metadata initialized successfully Execution time: 2.8870 seconds
OpenJDK 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in version 9.0 and will likely be removed in a future release. Failed to verify existence of migrations metadata stream 'MIGRATION_EVENTS'. Did you run
ksql-migrations initialize-metadata
? Error message: java.lang.IllegalStateException: Unexpected server response format. Response: {"@type":"sourceDescription","statementText":"describe MIGRATION_EVENTS;","sourceDescription":{"name":"MIGRATION_EVENTS","windowType":null,"readQueries":[{"queryString":"CREATE TABLE MIGRATION_SCHEMA_VERSIONS WITH (KAFKA_TOPIC='default_ksql_MIGRATION_SCHEMA_VERSIONS', PARTITIONS=1, REPLICAS=1) AS SELECT\n MIGRATION_EVENTS.VERSION_KEY VERSION_KEY,\n LATEST_BY_OFFSET(MIGRATION_EVENTS.VERSION) VERSION,\n LATEST_BY_OFFSET(MIGRATION_EVENTS.NAME) NAME,\n LATEST_BY_OFFSET(MIGRATION_EVENTS.STATE) STATE,\n LATEST_BY_OFFSET(MIGRATION_EVENTS.CHECKSUM) CHECKSUM,\n LATEST_BY_OFFSET(MIGRATION_EVENTS.STARTED_ON) STARTED_ON,\n LATEST_BY_OFFSET(MIGRATION_EVENTS.COMPLETED_ON) COMPLETED_ON,\n LATEST_BY_OFFSET(MIGRATION_EVENTS.PREVIOUS) PREVIOUS,\n LATEST_BY_OFFSET(MIGRATION_EVENTS.ERROR_REASON) ERROR_REASON\nFROM MIGRATION_EVENTS MIGRATION_EVENTS\nGROUP BY MIGRATION_EVENTS.VERSION_KEY\nEMIT CHANGES;","sinks":["MIGRATION_SCHEMA_VERSIONS"],"sinkKafkaTopics":["default_ksql_MIGRATION_SCHEMA_VERSIONS"],"id":"CTAS_MIGRATION_SCHEMA_VERSIONS_3","statusCount":{"RUNNING":1},"queryType":"PERSISTENT","state":"RUNNING"}],"writeQueries":[],"fields":[{"name":"VERSION_KEY","schema":{"type":"STRING","fields":null,"memberSchema":null},"type":"KEY"},{"name":"VERSION","schema":{"type":"STRING","fields":null,"memberSchema":null}},{"name":"NAME","schema":{"type":"STRING","fields":null,"memberSchema":null}},{"name":"STATE","schema":{"type":"STRING","fields":null,"memberSchema":null}},{"name":"CHECKSUM","schema":{"type":"STRING","fields":null,"memberSchema":null}},{"name":"STARTED_ON","schema":{"type":"STRING","fields":null,"memberSchema":null}},{"name":"COMPLETED_ON","schema":{"type":"STRING","fields":null,"memberSchema":null}},{"name":"PREVIOUS","schema":{"type":"STRING","fields":null,"memberSchema":null}},{"name":"ERROR_REASON","schema":{"type":"STRING","fields":null,"memberSchema":null}}],"type":"STREAM","timestamp":"","statistics":"","errorStats":"","extended":false,"keyFormat":"KAFKA","valueFormat":"JSON","topic":"default_ksql_MIGRATION_EVENTS","partitions":0,"replication":0,"statement":"CREATE STREAM MIGRATION_EVENTS (VERSION_KEY STRING KEY, VERSION STRING, NAME STRING, STATE STRING, CHECKSUM STRING, STARTED_ON STRING, COMPLETED_ON STRING, PREVIOUS STRING, ERROR_REASON STRING) WITH (KAFKA_TOPIC='default_ksql_MIGRATION_EVENTS', KEY_FORMAT='KAFKA', PARTITIONS=1, REPLICAS=1, VALUE_FORMAT='JSON');","queryOffsetSummaries":[]},"warnings":[]} Execution time: 0.8370 secondsCurrent migration version: 1
Version | Name | State | Previous Version | Started On | Completed On | Error Reason
1 | Initial setup | MIGRATED | | 2021-03-03 23:47:50.455 PST | 2021-03-03 23:47:50.689 PST | N/A
The ksql-migrations tool is available with all ksqlDB versions starting from ksqlDB 0.17 or Confluent Platform 6.2. You can use the tool to manage any ksqlDB cluster running version ksqlDB 0.10 (Confluent Platform 6.0) or newer.