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

Fix Attaching a table with non-existent ZK path does not increase the ReadonlyReplica metric #48954

Merged

Conversation

wzb5212
Copy link
Contributor

@wzb5212 wzb5212 commented Apr 19, 2023

Changelog category (leave one):

  • Bug Fix (user-visible misbehavior in an official stable release)

Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):

Fix Attaching a table with non-existent ZK path does not increase the ReadonlyReplica metric, may be fix #16045

ATTACH TABLE test_no_zk UUID 'a50b7933-59b2-49ce-8db6-59da3c9b4413'
(
    `i` Int8,
    `d` Date
)
ENGINE = ReplicatedMergeTree('no_zk', 'replica')
ORDER BY tuple()

0 rows in set. Elapsed: 0.007 sec.

Row 1:
──────
database:                    test
table:                       test_no_zk
engine:                      ReplicatedMergeTree
is_leader:                   0
can_become_leader:           1
is_readonly:                 1
is_session_expired:          0
future_parts:                0
parts_to_check:              0
zookeeper_path:              /no_zk
replica_name:                replica
replica_path:                /no_zk/replicas/replica
columns_version:             -1
queue_size:                  0
inserts_in_queue:            0
merges_in_queue:             0
part_mutations_in_queue:     0
queue_oldest_time:           1970-01-01 08:00:00
inserts_oldest_time:         1970-01-01 08:00:00
merges_oldest_time:          1970-01-01 08:00:00
part_mutations_oldest_time:  1970-01-01 08:00:00
oldest_part_to_get:
oldest_part_to_merge_to:
oldest_part_to_mutate_to:
log_max_index:               0
log_pointer:                 0
last_queue_update:           1970-01-01 08:00:00
absolute_delay:              1681923781
total_replicas:              0
active_replicas:             0
lost_part_count:             0
last_queue_update_exception:
zookeeper_exception:         Code: 999. Coordination::Exception: /no_zk/log (No node). (KEEPER_EXCEPTION) (version 23.4.1.1)
replica_is_active:           {}

1 row in set. Elapsed: 0.006 sec.

SELECT *
FROM system.metrics
WHERE metric = 'ReadonlyReplica'

Query id: ff118b33-1835-49e9-8d23-aff67234e944

┌─metric──────────┬─value─┬─description────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ ReadonlyReplica │     1 │ Number of Replicated tables that are currently in readonly state due to re-initialization after ZooKeeper session loss or due to startup without ZooKeeper configured. │
└─────────────────┴───────┴────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘

@CLAassistant
Copy link

CLAassistant commented Apr 19, 2023

CLA assistant check
All committers have signed the CLA.

@den-crane
Copy link
Contributor

please add a test

@wzb5212
Copy link
Contributor Author

wzb5212 commented Apr 19, 2023

please add a test

ok.

@wzb5212
Copy link
Contributor Author

wzb5212 commented Apr 20, 2023

please add a test

I added an integration test, please take a look.

@den-crane den-crane added the can be tested Allows running workflows for external contributors label Apr 21, 2023
@wzb5212
Copy link
Contributor Author

wzb5212 commented Apr 27, 2023

@den-crane some ci test failed , please take a look.

@tavplubix tavplubix self-assigned this May 3, 2023
@tavplubix
Copy link
Member

tavplubix commented May 3, 2023

some ci test failed , please take a look.

You can take a look yourself. There's a "Details" link for each failed check, it opens a report with a list of failed tests and links to relevant logs. Also you can use our public CI database to check if some test is flaky/broken in master (example). But these failures are not related to your changes, so it's okay.

Integration tests (asan) [3/6] - test_backup_restore_on_cluster is flaky - #45486
Stateless tests (release, analyzer) - it's a new check with new analyzer, and it's broken in master
Stateless tests (ubsan) [2/2] - 01676_clickhouse_client_autocomplete is flaky

@tavplubix tavplubix merged commit 2924837 into ClickHouse:master May 3, 2023
@wzb5212
Copy link
Contributor Author

wzb5212 commented May 4, 2023

some ci test failed , please take a look.

You can take a look yourself. There's a "Details" link for each failed check, it opens a report with a lost of failed tests and links to relevant logs. Also you can use our public CI database to check if some test is flaky/broken in master (example). But these failures are not related to your changes, so it's okay.

Integration tests (asan) [3/6] - test_backup_restore_on_cluster is flaky - #45486 Stateless tests (release, analyzer) - it's a new check with new analyzer, and it's broken in master Stateless tests (ubsan) [2/2] - 01676_clickhouse_client_autocomplete is flaky

thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
can be tested Allows running workflows for external contributors pr-bugfix Pull request with bugfix, not backported by default
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Attaching a table with non-existent ZK path does not increase the ReadonlyReplica metric
5 participants