02-after-environmentd-restart.td 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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. # Verify that the data ingested before `environmentd` was killed is still
  10. # present, then try ingesting more data.
  11. # Increased from the default because of CI flakiness.
  12. $ set-sql-timeout duration=180s
  13. > SELECT * from remote1
  14. one
  15. two
  16. > SELECT * from remote2
  17. one
  18. two
  19. # ensure after envd has restarted, we have maintained statistics.
  20. > SELECT s.name,
  21. SUM(u.updates_committed) > 0,
  22. SUM(u.messages_received) >= 2,
  23. SUM(u.offset_known),
  24. SUM(u.offset_committed)
  25. FROM mz_sources s
  26. JOIN mz_internal.mz_source_statistics_raw u ON s.id = u.id
  27. WHERE s.name IN ('remote1', 'remote2')
  28. GROUP BY s.id, s.name
  29. remote1 true true 2 2
  30. remote2 true true 2 2
  31. > SELECT s.name,
  32. SUM(u.updates_committed)
  33. FROM mz_sources s
  34. JOIN mz_internal.mz_source_statistics_raw u ON s.id = u.id
  35. WHERE s.name IN ('webhook_text')
  36. GROUP BY s.id, s.name
  37. webhook_text 1
  38. $ kafka-ingest format=bytes topic=remote1
  39. three
  40. $ kafka-ingest format=bytes topic=remote2
  41. three
  42. $ webhook-append database=materialize schema=public name=webhook_text
  43. b
  44. > SELECT * from remote1
  45. one
  46. two
  47. three
  48. > SELECT * from remote2
  49. one
  50. two
  51. three
  52. # Ensure that offsets/counters can be updated correctly.
  53. > SELECT s.name,
  54. SUM(u.updates_committed) > 0,
  55. SUM(u.messages_received) >= 4,
  56. SUM(u.offset_known),
  57. SUM(u.offset_committed)
  58. FROM mz_sources s
  59. JOIN mz_internal.mz_source_statistics_raw u ON s.id = u.id
  60. WHERE s.name IN ('remote1', 'remote2')
  61. GROUP BY s.id, s.name
  62. remote1 true true 3 3
  63. remote2 true true 3 3
  64. > SELECT s.name,
  65. SUM(u.updates_committed)
  66. FROM mz_sources s
  67. JOIN mz_internal.mz_source_statistics_raw u ON s.id = u.id
  68. WHERE s.name IN ('webhook_text')
  69. GROUP BY s.id, s.name
  70. webhook_text 2