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

missing destination name \"d.path\" in *clickhouse.Disk" #1007

Closed
armanzhakypbayev opened this issue Sep 10, 2024 · 9 comments
Closed

missing destination name \"d.path\" in *clickhouse.Disk" #1007

armanzhakypbayev opened this issue Sep 10, 2024 · 9 comments
Milestone

Comments

@armanzhakypbayev
Copy link

ClickHouse server version 23.10.3.5 (official build).
root@db-clickhouse-ipsdev2:~# clickhouse-backup --version
Version: 2.6.0
Git Commit: b7faa4a
Build Date: 2024-08-29

root@db-clickhouse-ipsdev2:~# clickhouse-backup create test --env CLICKHOUSE_PASSWORD=***
failed with:

2024-09-10 09:57:18.479 INF pkg/clickhouse/clickhouse.go:1071 > SELECT countIf(name='type') AS is_disk_type_present, countIf(name='object_storage_type') AS is_object_storage_type_present, countIf(name='free_space') AS is_free_space_present, countIf(name='disks') AS is_storage_policy_present FROM system.columns WHERE database='system' AND table IN ('disks','storage_policies')
2024-09-10 09:57:18.499 INF pkg/clickhouse/clickhouse.go:1071 > SELECT d.path, any(d.name) AS name, any(d.type) AS type, min(d.free_space) AS free_space, groupUniqArray(s.policy_name) AS storage_policies FROM system.disks AS d LEFT JOIN (SELECT policy_name, arrayJoin(disks) AS disk FROM system.storage_policies) AS s ON s.disk = d.name GROUP BY d.path
2024-09-10 09:57:18.502 INF pkg/clickhouse/clickhouse.go:319 > clickhouse connection closed
2024-09-10 09:57:18.502 FTL cmd/clickhouse-backup/main.go:658 > error="clickhouse [ScanStruct]: missing destination name "d.path" in *clickhouse.Disk"

Can you please help me?

@Slach
Copy link
Collaborator

Slach commented Sep 12, 2024

sorry for late reply, could you share result of

clickhouse-client --password=*** -q "SELECT d.path, any(d.name) AS name, any(d.type) AS type, min(d.free_space) AS free_space, groupUniqArray(s.policy_name) AS storage_policies FROM system.disks AS d LEFT JOIN (SELECT policy_name, arrayJoin(disks) AS disk FROM system.storage_policies) AS s ON s.disk = d.name GROUP BY d.path FORMAT Vertical"

@armanzhakypbayev
Copy link
Author

Hi, thank you for your reply!

root@db-clickhouse-ipsdev2:~# clickhouse-client --password=*** -q "SELECT d.path, any(d.name) AS name, any(d.ty
pe) AS type, min(d.free_space) AS free_space, groupUniqArray(s.policy_name) AS storage_policies FROM system.disks AS d L
EFT JOIN (SELECT policy_name, arrayJoin(disks) AS disk FROM system.storage_policies) AS s ON s.disk = d.name GROUP BY d.
path FORMAT Vertical"
Row 1:
──────
d.path: /var/lib/clickhouse/
name: default
type: local
free_space: 83931381760
storage_policies: ['default']

@Slach
Copy link
Collaborator

Slach commented Sep 13, 2024

Oh, looks weird

I tried reproduce query
https://fiddle.clickhouse.com/f97f3db4-7188-42f0-9fdd-533e32077b00

for the same clickhouse-server version
but got different result

Row 1:
──────
path:             /var/lib/clickhouse/
name:             default
type:             local
free_space:       1985749671936
storage_policies: ['default']

I don't see d.path

could you share?

SELECT * FROM system.settings WHERE changed

@armanzhakypbayev
Copy link
Author

yeah I see, actually I dont know did we change this settings but from the select it seems not

image

@armanzhakypbayev
Copy link
Author

armanzhakypbayev commented Sep 13, 2024

Also I have another clickhouse server:

~# clickhouse-client --user=*** --password=*** -q "SELECT d.path, any(d
.name) AS name, any(d.type) AS type, min(d.free_space) AS free_space, groupUniqArray(s.policy_name) AS storage_policies
FROM system.disks AS d LEFT JOIN (SELECT policy_name, arrayJoin(disks) AS disk FROM system.storage_policies) AS s ON s.d
isk = d.name GROUP BY d.path FORMAT Vertical"
Row 1:
──────
d.path: /var/lib/clickhouse/
name: default
type: local
free_space: 63939837952
storage_policies: ['default']

~# clickhouse-server --version
ClickHouse server version 23.7.4.5 (official build).

changed setting in the second server the same except there is no 'max_query_size' (it is default)

@Slach
Copy link
Collaborator

Slach commented Sep 13, 2024

could you share
clickhouse-client -q "SELECT * FROM system.settings WHERE changed FORMAT Vertical"
as text

@Slach Slach closed this as completed in 7ee1178 Sep 13, 2024
@Slach Slach added this to the 2.6.2 milestone Sep 13, 2024
@armanzhakypbayev
Copy link
Author

sure

Row 1:
──────
name:        max_query_size
value:       2621440
changed:     1
description: The maximum number of bytes of a query string parsed by the SQL parser. Data in the VALUES clause of INSERT queries is processed by a separate stream parser (that consumes O(1) RAM) and not affected by this restriction.
min:         ᴺᵁᴸᴸ
max:         ᴺᵁᴸᴸ
readonly:    0
type:        UInt64
default:     262144
alias_for:
is_obsolete: 0

Row 2:
──────
name:        join_use_nulls
value:       1
changed:     1
description: Use NULLs for non-joined rows of outer JOINs for types that can be inside Nullable. If false, use default value of corresponding columns data type.
min:         ᴺᵁᴸᴸ
max:         ᴺᵁᴸᴸ
readonly:    0
type:        Bool
default:     0
alias_for:
is_obsolete: 0

Row 3:
──────
name:        allow_experimental_analyzer
value:       1
changed:     1
description: Allow experimental analyzer
min:         ᴺᵁᴸᴸ
max:         ᴺᵁᴸᴸ
readonly:    0
type:        Bool
default:     0
alias_for:
is_obsolete: 0

@Slach
Copy link
Collaborator

Slach commented Sep 13, 2024

wrong behavior fixed in clickhouse-server 24.3
https://fiddle.clickhouse.com/310de429-201b-4d4f-a7a0-e7549cf462e5

@Slach
Copy link
Collaborator

Slach commented Sep 17, 2024

ok. found root reason
combination of join_use_nulls=1, allow_experimental_analyzer=1
reproduced in 23.3+

fixed in 24.3
https://fiddle.clickhouse.com/310de429-201b-4d4f-a7a0-e7549cf462e5

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

2 participants