I'm sorry, but the knowledge sources provided do not contain any explicit information about the specific error message "Sync completed, but unflushed states were detected." in the context of the ClickHouse v2 connector, nor do they detail issues with the Mapper configuration compared to v1. However, there are several known migration and behavioral changes between ClickHouse connector v1 and v2 that could potentially impact syncs and state handling: - The v2 connector is a complete rewrite, with changes in how data is written (typed columns instead of raw JSON), how namespaces/databases are handled, and stricter configuration requirements (e.g., hostnames must not include protocol prefixes) [ClickHouse Migration Guide](
https://docs.airbyte.com/integrations/destinations/clickhouse-migrations). - There have been reports of schema evolution and state handling bugs in early v2 releases, with several fixes and improvements in recent versions (see the changelog for details) [ClickHouse Changelog](
https://docs.airbyte.com/integrations/destinations/clickhouse#changelog). - Some users have encountered issues with deduplication, column name sanitization, and state message formats, especially when using custom sources or when the state message emitted by the source does not match the expected format (e.g., missing attributes like sourceStats) [GitHub Issue 69140](
https://github.com/airbytehq/airbyte/issues/69140). If you are seeing this error consistently: - Ensure you are running the latest version of the ClickHouse connector, as many bugs have been fixed in recent releases. - Double-check your source connector's state message format, especially if you are using a custom source. - Review your configuration for any migration gotchas, such as namespace/database handling or protocol in the hostname. If you can provide the stacktrace or more details about your setup (Airbyte version, source connector, sync mode, etc.), it may help narrow down the issue further. Unfortunately, without more specific information or a direct match in the knowledge sources, I can't provide a definitive answer. If the problem persists, I recommend opening a GitHub issue with detailed logs and configuration, or joining the Airbyte Slack for more direct support from the team and community [ClickHouse Beta Slack](
https://join.slack.com/t/airbytehq/shared_invite/zt-380cpipgm-wcaGDoS2qKZd6Q1gq4w7BA) (though note the beta channel may be closed post-GA) [ClickHouse V2 Beta Discussion](
https://github.com/airbytehq/airbyte/discussions/62035).