Skip to content

[ENH]: add validation during garbage collection for empty file paths #4586

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

Open
wants to merge 1 commit into
base: feat-gc-orchestrator-v2
Choose a base branch
from

Conversation

codetheweb
Copy link
Contributor

@codetheweb codetheweb commented May 20, 2025

Description of changes

Adds a defensive check that validates that the current version is v0 if there are no file paths.

Test plan

How are these changes tested?

  • Tests pass locally with pytest for python, yarn test for js, cargo test for rust

Added a test.

Documentation Changes

Are all docstrings for user-facing APIs updated if required? Do we need to make documentation changes in the docs section?

n/a

Copy link

Reviewer Checklist

Please leverage this checklist to ensure your code review is thorough before approving

Testing, Bugs, Errors, Logs, Documentation

  • Can you think of any use case in which the code does not behave as intended? Have they been tested?
  • Can you think of any inputs or external events that could break the code? Is user input validated and safe? Have they been tested?
  • If appropriate, are there adequate property based tests?
  • If appropriate, are there adequate unit tests?
  • Should any logging, debugging, tracing information be added or removed?
  • Are error messages user-friendly?
  • Have all documentation changes needed been made?
  • Have all non-obvious changes been commented?

System Compatibility

  • Are there any potential impacts on other parts of the system or backward compatibility?
  • Does this change intersect with any items on our roadmap, and if so, is there a plan for fitting them together?

Quality

  • Is this code of a unexpectedly high quality (Readability, Modularity, Intuitiveness)

Copy link
Contributor

propel-code-bot bot commented May 20, 2025

Add Defensive Validation for Empty File Paths in Garbage Collection

This PR introduces a defensive check in the garbage collector orchestrator to validate that if no file paths are present during garbage collection, the current version and all of its ancestors must be version 0. The update adds a fail-fast invariant in code execution and includes a new test to confirm this behavior. It also includes refactoring of test mock infrastructure in TestSysDb to improve replica handling for version file paths.

Key Changes:
• Added a validation check in GarbageCollectorOrchestratorV2 that verifies empty file paths are only allowed when the version is 0 and all ancestors are also at v0.
• Stored the version graph in orchestrator state for this validation.
• Introduced a detailed error if this invariant is violated.
• Added a corresponding test to ensure the invariant triggers errors appropriately.
• Refactored the test sysdb infrastructure to standardize storage of version file paths on the Collection struct and to update collection version file paths wherever previously a side-table was used.

Affected Areas:
• rust/garbage_collector/src/garbage_collector_orchestrator_v2.rs
• rust/sysdb/src/test_sysdb.rs

This summary was automatically generated by @propel-code-bot

@codetheweb codetheweb force-pushed the feat-gc-orchestrator-v2 branch from a72bc81 to 5c86e1c Compare May 20, 2025 21:27
@codetheweb codetheweb force-pushed the feat-validate-file-paths-during-gc branch from b8ab357 to 76c115d Compare May 20, 2025 21:27
@codetheweb codetheweb force-pushed the feat-gc-orchestrator-v2 branch from 5c86e1c to 2191cf0 Compare May 20, 2025 22:02
@codetheweb codetheweb force-pushed the feat-validate-file-paths-during-gc branch from 76c115d to 02546b5 Compare May 20, 2025 22:02
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

Successfully merging this pull request may close these issues.

1 participant