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

Schemer: no need to migrate schema from pod which hasn't been created #479

Closed
slimtom95 opened this issue Jul 27, 2020 · 16 comments
Closed

Comments

@slimtom95
Copy link

In a concile process, it's no need to migrate schema from the hosts that we know it's not exist and will be created later;

Schemer can really hang there for some time to wait invisible nodes respond.

@alex-zaitsev
Copy link
Member

Schemer uses the load balancer and skip_unavailable_shards setting, so it should not go to inactive pods.

@Sallery-X
Copy link
Contributor

the process spent too a lot time,i think when we create new cluster,no need to migrating schema objects to host
image

@Sallery-X
Copy link
Contributor

flag that mean the old chi is nil.

@Sallery-X
Copy link
Contributor

@alex-zaitsev

@slimtom95
Copy link
Author

Please read this log screenshots, it did ask invisible pods to answer.

image

@alex-zaitsev
Copy link
Member

ok. For some reason it does not fail fast in your environment and waits 10 seconds timeout every time.

@Slach
Copy link
Collaborator

Slach commented Jul 31, 2020

@SalleryWang @slimtom95 , could you answer to following questions:

look like your fork contains error in schemer.go and you tried get schema objects from unavailable hosts which not exists now

for example from shared PDF file

I0727 01:21:53.570763 1 schemer.go:247] Migrating schema objects to host 28-2
I0727 01:21:53.570839 1 schemer.go:193] Extracting replicated table definitions from [chi-ck-bo7s4lw7ax-31-0.ck�bo7s4lw7ax.svc.cluster.local chi-ck-bo7s4lw7ax-31-1.ck�bo7s4lw7ax.svc.cluster.local]
I0727 01:21:53.623319 1 connection.go:95] FAILED Query(http://
***:***@chi-ck-bo7s4lw7ax-0-0.ck-bo7s4lw7ax.svc.cluster.local:8123/) 
clickhouse: Code: 90, e.displayText() = DB::Exception: Empty list of 
columns passed (version 19.17.4.11 (official build))
 for SQL: SELECT DISTINCT 
database AS name, 
concat('CREATE DATABASE IF NOT EXISTS "', name, '"') AS 
create_db_query
FROM remote('chi-ck-bo7s4lw7ax-31-0.ckbo7s4lw7ax.svc.cluster.local,chi-ck-bo7s4lw7ax-31-1.ck�bo7s4lw7ax.svc.cluster.local', system, tables)
WHERE database != 'system'
SETTINGS skip_unavailable_shards = 1

I don't know why your custom operator fork tried to connect to chi-ck-bo7s4lw7ax-0-0 instead of chi-ck-bo7s4lw7ax-28-2?

@Sallery-X
Copy link
Contributor

not a fork,it‘s origin

@Slach
Copy link
Collaborator

Slach commented Jul 31, 2020

@SalleryWang which clickhouse-operator version did you use?

@Sallery-X
Copy link
Contributor

@Slach v0.10.0

@Slach
Copy link
Collaborator

Slach commented Aug 3, 2020

@SalleryWang in v0.10.0
part of code which you share in #479 (comment)

looks different than part of worker.go in current 0.10.0
https://github.com/Altinity/clickhouse-operator/blob/master/pkg/controller/chi/worker.go#L398

image

ok. after internal discussion we decided to improve schemer.go to avoid create tables when creating ClickHouse cluster from scratch

@Sallery-X
Copy link
Contributor

fine

@Sallery-X
Copy link
Contributor

I just made a little change to avoid migrating schema from pod which hasn't been created, The premise is i use cloud disk. so I think this is fine

@Sallery-X
Copy link
Contributor

@Slach

@alex-zaitsev
Copy link
Member

Fixed in 0.11.0

@alex-zaitsev
Copy link
Member

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

No branches or pull requests

4 participants