Repository navigation
Commit 78143c8
authored
feat(app): prefer shared MergeTree settings (#3570)
## Summary
On ClickHouse Cloud, read MergeTree settings from `system.shared_merge_tree_settings`, falling back to `system.merge_tree_settings` for each setting, when detecting persisted `_block_number` and `_block_offset` columns.
- `Metadata.getMergeTreeSettings` also reads `system.shared_merge_tree_settings` on Cloud (detected with `isClickHouseCloud`). Where both tables set a key, the shared value wins
- Outside Cloud it still reads only `system.merge_tree_settings`, since OSS servers don't have the shared table
- If the shared read fails on Cloud, it returns `undefined` (not cached), so the next call retries
- Unit tests for the non-Cloud path, the Cloud per-key preference, and the Cloud failure case
The code is identical to the EE change, so the forward-port should merge without conflicts.
### How to reproduce
**Starting point:** a ClickHouse Cloud service where block columns are enabled in the shared settings but not in `system.merge_tree_settings`. Check with:
```sql
SELECT 'merge_tree' AS t, name, value FROM system.merge_tree_settings WHERE name LIKE 'enable_block_%'
UNION ALL
SELECT 'shared', name, value FROM system.shared_merge_tree_settings WHERE name LIKE 'enable_block_%'
```
Add a log table on that service as a source, with no block-column settings in its `SETTINGS` clause, and ingest some rows.
**On `main`:**
1. Open the source in search and click a row.
2. In the ClickHouse query log, the row lookup doesn't use `_block_number` / `_block_offset` and falls back to matching the full row.
**On this branch:**
1. Repeat the steps above.
2. The row lookup now selects and filters on `_block_number` and `_block_offset`.
### How to test on Vercel preview
N/A — non-UI change.
### References
- Linear Issue: O11Y-29693
- Related PRs: backport of DeploySentinel/hyperdx-ee#3925, follows #35301 parent 3a412e4 commit 78143c8
3 files changed
Lines changed: 109 additions & 20 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
547 | 547 | | |
548 | 548 | | |
549 | 549 | | |
550 | | - | |
551 | | - | |
552 | | - | |
553 | | - | |
554 | | - | |
555 | | - | |
556 | | - | |
557 | | - | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
558 | 565 | | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
559 | 579 | | |
560 | 580 | | |
561 | 581 | | |
| |||
568 | 588 | | |
569 | 589 | | |
570 | 590 | | |
| 591 | + | |
571 | 592 | | |
572 | 593 | | |
573 | 594 | | |
574 | 595 | | |
575 | 596 | | |
576 | 597 | | |
577 | 598 | | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
578 | 644 | | |
579 | 645 | | |
580 | 646 | | |
581 | 647 | | |
582 | 648 | | |
| 649 | + | |
583 | 650 | | |
584 | 651 | | |
585 | 652 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2242 | 2242 | | |
2243 | 2243 | | |
2244 | 2244 | | |
2245 | | - | |
2246 | | - | |
| 2245 | + | |
| 2246 | + | |
| 2247 | + | |
2247 | 2248 | | |
2248 | 2249 | | |
2249 | 2250 | | |
2250 | 2251 | | |
2251 | 2252 | | |
2252 | 2253 | | |
| 2254 | + | |
| 2255 | + | |
| 2256 | + | |
| 2257 | + | |
| 2258 | + | |
| 2259 | + | |
| 2260 | + | |
| 2261 | + | |
| 2262 | + | |
| 2263 | + | |
| 2264 | + | |
2253 | 2265 | | |
2254 | 2266 | | |
2255 | 2267 | | |
2256 | 2268 | | |
2257 | | - | |
2258 | | - | |
2259 | | - | |
2260 | | - | |
2261 | | - | |
2262 | | - | |
2263 | | - | |
2264 | | - | |
2265 | | - | |
2266 | | - | |
| 2269 | + | |
| 2270 | + | |
| 2271 | + | |
| 2272 | + | |
| 2273 | + | |
| 2274 | + | |
| 2275 | + | |
| 2276 | + | |
| 2277 | + | |
| 2278 | + | |
| 2279 | + | |
| 2280 | + | |
| 2281 | + | |
| 2282 | + | |
2267 | 2283 | | |
2268 | 2284 | | |
2269 | 2285 | | |
| |||
0 commit comments