-
Notifications
You must be signed in to change notification settings - Fork 11
Remove host from table metadata with excluded paths in config #430
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
Conversation
Reviewer's GuideMake Zookeeper table/database metadata cleanup use configurable excluded_paths from chadmin.zookeeper.clean_zk_metadata_for_hosts instead of a hardcoded list, and add a feature test validating that cleanup respects configured exclusions. Sequence diagram for configurable excluded_paths in Zookeeper metadata cleanupsequenceDiagram
participant Config as clean_zk_metadata_for_hosts_config
participant Cleanup as cleanup_tables_and_databases
participant Collector as _collect_objects_for_cleanup
participant Traverser as _traverse_zk_tree_and_find_objects
Config->>Cleanup: provide workers, retry_min_wait_sec, retry_max_wait_sec, max_retries, excluded_paths
Cleanup->>Cleanup: configure retry_decorator and max_workers
Cleanup->>Collector: call with zk, zk_root_path, collect_tables, collect_database, excluded_paths, max_workers
Collector->>Traverser: traverse Zookeeper tree and find replicated_objects
Traverser-->>Collector: replicated_objects
Collector->>Collector: filter replicated_objects using excluded_paths
Collector-->>Cleanup: tables_for_cleanup, databases_for_cleanup
Cleanup->>Cleanup: delete non_excluded tables and databases metadata
Cleanup-->>Config: operation completes using configured excluded_paths
Class diagram for updated Zookeeper cleanup configuration and helper functionclassDiagram
class CleanZkMetadataForHostsConfig {
int workers
int retry_min_wait_sec
int retry_max_wait_sec
int max_retries
List~string~ excluded_paths
}
class ZookeeperCleanModule {
+cleanup_tables_and_databases(zk, zk_root_path)
+_collect_objects_for_cleanup(zk, zk_root_path, collect_tables, collect_database, excluded_paths, max_workers) Tuple
}
CleanZkMetadataForHostsConfig <.. ZookeeperCleanModule : reads
ZookeeperCleanModule ..> CleanZkMetadataForHostsConfig : uses excluded_paths
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey there - I've reviewed your changes - here's some feedback:
- Accessing
clean_zk_metadata_for_hosts["excluded_paths"]directly will break existing deployments that don't yet define this key; consider using.get("excluded_paths", DEFAULT_LIST)or similar to preserve backward compatibility with older configs.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Accessing `clean_zk_metadata_for_hosts["excluded_paths"]` directly will break existing deployments that don't yet define this key; consider using `.get("excluded_paths", DEFAULT_LIST)` or similar to preserve backward compatibility with older configs.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
While removing host from table's metadata we used hardcoded values for
excluded_paths.Now it is configurable in config - default values are unchanged.
Summary by Sourcery
Make Zookeeper table metadata cleanup respect configurable exclusion patterns instead of hardcoded ones.
New Features:
Enhancements:
Tests: