Skip to content

Conversation

@mkysel
Copy link
Collaborator

@mkysel mkysel commented Aug 13, 2025

Add CountDeletable configuration option to prune.Executor.Run method and modify pruning loop termination logic to stop when batch deletes fewer rows than BatchSize

  • Adds CountDeletable boolean field to config.PruneConfig struct with CLI flag and environment variable support in pkg/config/pruneOptions.go
  • Modifies prune.Executor.Run method to conditionally count deletable envelopes based on CountDeletable configuration and changes loop termination to stop when batch deletes fewer rows than BatchSize in pkg/prune/prune.go
  • Introduces CapturingWriteSyncer and CapturingLogger test utilities for in-memory log capture in pkg/testutils/log.go
  • Adds test case TestExecutor_PruneCountWorks to verify counting functionality in pkg/prune/prune_test.go

📍Where to Start

Start with the prune.Executor.Run method in pkg/prune/prune.go to understand the core pruning logic changes and how the new CountDeletable configuration affects execution flow.


Macroscope summarized 792cd72.

@mkysel mkysel requested a review from a team as a code owner August 13, 2025 00:19
@graphite-app
Copy link

graphite-app bot commented Aug 13, 2025

How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • Queue - adds this PR to the back of the merge queue
  • Hotfix - for urgent hot fixes, skip the queue and merge this PR next

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

@mkysel
Copy link
Collaborator Author

mkysel commented Aug 13, 2025

Closes #983

@mkysel mkysel linked an issue Aug 13, 2025 that may be closed by this pull request
Comment on lines +40 to +42
func (c *CapturingWriteSyncer) Sync() error {
return nil
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we free the memory on sync?

@mkysel mkysel merged commit 02fe525 into main Aug 13, 2025
10 checks passed
@mkysel mkysel deleted the mkysel/node-go-pruner branch August 13, 2025 17:00
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.

Migrate pruner improvements from node-go

3 participants