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

Implementing tree traversal for pruning stale actions #340

Closed

Conversation

blakehatch
Copy link
Member

@blakehatch blakehatch commented Oct 25, 2023

Description

CAS needs to be pruned of stale actions

Approach:

  • In the running_actions_manager, iterate through all of the actions in ac_store and determine whether an action is stale using it's metadata if it was run longer ago than the threshold.
    • This requires adding functionality to iterate through stores, holding off on implementing unless necessary to
      implement in all stores.
  • After iterating collect the list of just the stale actions
  • In cas_server do a DFS walk through the tree using the root_node found with get_tree
    • While walking tree, compare the stale actions list to the digest in the tree, if the digest in the tree is contained in the
      list of stale actions then remove it from the tree.

Fixes #329

Type of change

Please delete options that are not relevant.

  • New feature (non-breaking change which adds functionality)
  • This change requires a documentation update

How Has This Been Tested?

  • Testing that all actions in the action cache are found
    • Assume it's in a file for simplicity
  • Testing that all stale actions in the action cache are found
  • Testing that DFS walk down the tree works properly
  • Test that removing stale digests from the tree is working and that the
    • Account for touching anything in the cas re-promote it to the top of the queue.

Checklist

  • Updated documentation if needed
  • Tests added/amended
  • bazel test //... passes locally
  • PR is contained in a single commit, using git amend see some docs

This change is Reviewable

@blakehatch blakehatch force-pushed the action-cache-cleaner branch 2 times, most recently from f5fda87 to b875024 Compare October 26, 2023 01:07
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.

Un-referenced Item Cleaner
1 participant