avro-resolution-no-publish-writer.td 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. # Copyright Materialize, Inc. and contributors. All rights reserved.
  2. #
  3. # Use of this software is governed by the Business Source License
  4. # included in the LICENSE file at the root of this repository.
  5. #
  6. # As of the Change Date specified in that file, in accordance with
  7. # the Business Source License, use of this software will be governed
  8. # by the Apache License, Version 2.0.
  9. $ set-arg-default single-replica-cluster=quickstart
  10. #
  11. # Test the case where we fail to publish the schema of the writer
  12. #
  13. $ set int-schema={"type": "record", "name": "schema_int", "fields": [ {"name": "f1", "type": "int"} ] }
  14. $ kafka-create-topic topic=resolution-no-publish-writer
  15. $ kafka-ingest format=avro topic=resolution-no-publish-writer schema=${int-schema} timestamp=1
  16. {"f1": 123}
  17. $ postgres-execute connection=postgres://mz_system@${testdrive.materialize-internal-sql-addr}/materialize
  18. DROP SCHEMA IF EXISTS public CASCADE
  19. CREATE SCHEMA public
  20. GRANT CREATE, USAGE ON SCHEMA public TO materialize
  21. > CREATE CONNECTION IF NOT EXISTS csr_conn TO CONFLUENT SCHEMA REGISTRY (
  22. URL '${testdrive.schema-registry-url}'
  23. );
  24. > CREATE CONNECTION kafka_conn
  25. TO KAFKA (BROKER '${testdrive.kafka-addr}', SECURITY PROTOCOL PLAINTEXT);
  26. > CREATE SOURCE resolution_no_publish_writer
  27. IN CLUSTER ${arg.single-replica-cluster}
  28. FROM KAFKA CONNECTION kafka_conn (TOPIC 'testdrive-resolution-no-publish-writer-${testdrive.seed}')
  29. FORMAT AVRO USING CONFLUENT SCHEMA REGISTRY CONNECTION csr_conn
  30. ENVELOPE NONE
  31. # The value is {"f1": 123}, schema_id = 0x1000000 (16777216) - that should be far beyond what the previous tests create
  32. # We encode it manually to avoid publishing it.
  33. $ kafka-ingest format=bytes topic=resolution-no-publish-writer timestamp=1
  34. \\x00\x01\x00\x00\x00\xf6\x01
  35. SELECT status FROM mz_internal.mz_source_statuses WHERE source = 'resolution_no_publish_writer';
  36. stalled