mysql-source-after-ssh-restart.td 1.0 KB

12345678910111213141516171819202122232425262728293031323334
  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. # Ensure that the source becomes healthy again once the SSH tunnel is restarted.
  10. # We specifically make sure that new data written to the Kafka topic is visible
  11. # in the source, as that is the true measure of health, vs what is reported in
  12. # the mz_source_statuses relation.
  13. $ mysql-connect name=mysql url=mysql://root@mysql password=${arg.mysql-root-password}
  14. $ mysql-execute name=mysql
  15. USE dummyschema;
  16. INSERT INTO dummy VALUES (4);
  17. > SELECT f1 FROM dummy ORDER BY f1 ASC;
  18. 1
  19. 2
  20. 3
  21. 4
  22. > SELECT bool_and(error IS NULL)
  23. FROM mz_internal.mz_source_statuses
  24. WHERE
  25. name
  26. IN (
  27. SELECT name FROM (SHOW SUBSOURCES ON mysql_source WHERE type = 'subsource')
  28. );
  29. true