Skip to content

Commit

Permalink
[clickhouse] make table engines a warning instead of an error (#2056)
Browse files Browse the repository at this point in the history
There's engines like Distributed and other MergeTree family which could
also be used in special workloads. Until we have more understanding on
how these work and how common they are, don't block creation of mirrors.
  • Loading branch information
heavycrystal authored Sep 8, 2024
1 parent b4be6c7 commit a9bb42b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions flow/connectors/clickhouse/clickhouse.go
Original file line number Diff line number Diff line change
Expand Up @@ -305,9 +305,9 @@ func (c *ClickhouseConnector) checkTablesEmptyAndEngine(ctx context.Context, tab
if totalRows != 0 {
return fmt.Errorf("table %s exists and is not empty", tableName)
}
if !slices.Contains(acceptableTableEngines, engine) {
return fmt.Errorf("table %s exists but is not using ReplacingMergeTree/MergeTree engine,"+
" and is using %s instead", tableName, engine)
if !slices.Contains(acceptableTableEngines, strings.TrimPrefix(engine, "Shared")) {
c.logger.Warn("[clickhouse] table engine not explicitly supported",
slog.String("table", tableName), slog.String("engine", engine))
}
}
if rows.Err() != nil {
Expand Down
2 changes: 1 addition & 1 deletion flow/connectors/clickhouse/normalize.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const (
versionColType = "Int64"
)

var acceptableTableEngines = []string{"ReplacingMergeTree", "MergeTree", "SharedReplacingMergeTree"}
var acceptableTableEngines = []string{"ReplacingMergeTree", "MergeTree"}

func (c *ClickhouseConnector) StartSetupNormalizedTables(_ context.Context) (interface{}, error) {
return nil, nil
Expand Down
2 changes: 1 addition & 1 deletion ui/app/peers/create/[peerType]/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ export const chSchema = (hostDomains: string[]) =>
invalid_type_error: 'User must be a string',
})
.min(1, 'User must be non-empty')
.max(64, 'User must be less than 64 characters'),
.max(128, 'User must be less than 128 characters'),
password: z
.string({
invalid_type_error: 'Password must be a string',
Expand Down

0 comments on commit a9bb42b

Please sign in to comment.