Skip to content

Conversation

@kanwarujjaval
Copy link
Member

… support

@kanwarujjaval kanwarujjaval self-assigned this Dec 16, 2025
@kanwarujjaval kanwarujjaval changed the title feat: add ClickHouse database and table creation scripts with cluster… ch cluster Dec 16, 2025
@kanwarujjaval kanwarujjaval changed the title ch cluster ch cluster+replica+ha Dec 16, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds ClickHouse cluster support with database and table creation scripts. The changes focus on three main areas: configuring cluster-specific settings, cleaning up excessive debug logging in the API, and handling cluster mode for mutation validation.

Key Changes:

  • Added comprehensive ClickHouse cluster configuration options including replication, distributed writes, and parallel replicas
  • Modified mutation manager to detect cluster mode and validate against _local tables when appropriate
  • Removed extensive console.log debug statements from API startup, replacing with proper log calls

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
api/jobs/mutationManagerJob.js Added ClusterManager integration to handle validation table naming in cluster mode
api/configextender.js Added documentation comment explaining ClickHouse configuration override mechanism
api/config.sample.js Introduced cluster, replication, parallelReplicas, distributed, dictionary, and identity configuration sections
api/api.js Cleaned up debug console.log statements and replaced with proper log calls

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

let validationTable = task.collection;
if (ClusterManager) {
try {
const cm = new ClusterManager(countlyConfig.clickhouse || {});
Copy link

Copilot AI Dec 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Creating a new ClusterManager instance for every task in the loop is inefficient. Consider instantiating ClusterManager once before the loop and reusing it, or caching the cluster mode determination result.

Copilot uses AI. Check for mistakes.
@kanwarujjaval kanwarujjaval changed the title ch cluster+replica+ha [WIP] ch cluster+replica+ha Dec 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants