Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ClickHouse as a subprocess #5347

Merged
merged 19 commits into from
Sep 3, 2024
Merged

ClickHouse as a subprocess #5347

merged 19 commits into from
Sep 3, 2024

Conversation

esevastyanov
Copy link
Contributor

@esevastyanov esevastyanov commented Jul 30, 2024

Closes #5207

@esevastyanov esevastyanov marked this pull request as ready for review July 30, 2024 14:57
cli/cmd/start/clickhouse.go Outdated Show resolved Hide resolved
cli/cmd/start/clickhouse.go Outdated Show resolved Hide resolved
cli/cmd/start/clickhouse.go Outdated Show resolved Hide resolved
Comment on lines 74 to 78
if _, err := os.Stat(destPath); err == nil {
// ClickHouse binary already exists
// TODO: Check compatibility in case the binary is outdated.
return destPath, nil
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we just incorporate the version number in the path, i.e. ~/.rill/clickhouse/vXX/?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I haven't found a way to determine the version of the Clickhouse binary without running and querying it.

Copy link
Contributor

Choose a reason for hiding this comment

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

What if we pin to a specific version when downloading the binary? Like we pin to a specific DuckDB version. Then we would know it, right?

cli/cmd/start/clickhouse.go Outdated Show resolved Hide resolved
cli/cmd/start/clickhouse.go Outdated Show resolved Hide resolved
cli/cmd/start/clickhouse.go Outdated Show resolved Hide resolved
cli/cmd/start/clickhouse.go Outdated Show resolved Hide resolved
cli/cmd/start/clickhouse.go Outdated Show resolved Hide resolved
cli/cmd/start/start.go Outdated Show resolved Hide resolved
Copy link
Contributor

@begelundmuller begelundmuller left a comment

Choose a reason for hiding this comment

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

Caught up with Eugene and he mentioned the following todos are still outstanding:

  • Download the proper binary per OS and architecture
  • Pin to a specific ClickHouse version and cache it by version name in ~/.rill
  • Debug the timeout errors that occasionally occur

runtime/drivers/clickhouse/clickhouse.go Outdated Show resolved Hide resolved
runtime/drivers/clickhouse/clickhouse.go Outdated Show resolved Hide resolved
Comment on lines +75 to +77
if err := e.cmd.Wait(); err != nil {
e.logger.Error("clickhouse server exited with an error", zap.Error(err))
}
Copy link
Contributor

Choose a reason for hiding this comment

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

What about when there's a graceful shutdown (i.e. stop is called) – will ClickHouse shut down with status 0 or will there be some kind of error? If there's an error, we should probably skip it here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There is no error in case of a graceful shutdown

runtime/drivers/clickhouse/embed.go Outdated Show resolved Hide resolved
runtime/drivers/clickhouse/embed.go Outdated Show resolved Hide resolved
runtime/drivers/clickhouse/embed.go Outdated Show resolved Hide resolved
runtime/drivers/clickhouse/embed.go Outdated Show resolved Hide resolved
runtime/drivers/clickhouse/embed.go Outdated Show resolved Hide resolved
@begelundmuller begelundmuller merged commit 23b7372 into main Sep 3, 2024
7 checks passed
@begelundmuller begelundmuller deleted the clickhouse-sub-process branch September 3, 2024 10:26
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.

ClickHouse: Support starting ClickHouse as a sub-process
2 participants