Skip to content

Implement a flush command #2396

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

Merged
merged 6 commits into from
Jul 8, 2022
Merged

Conversation

dominiklohmann
Copy link
Member

@dominiklohmann dominiklohmann commented Jul 2, 2022

The new flush command causes VAST to decomission all currently active partitions, i.e., write all active partitions to disk immediately regardless of their size or the active partition timeout. This is particularly useful for testing, or when needing to guarantee in automated scripts that input is available for operations that only work on persisted passive partitions.

The flush command returns only after all active partitions were flushed to the disk.

📝 Checklist

  • All user-facing changes have changelog entries.
  • The changes are reflected on docs.tenzir.com/vast, if necessary.
  • The PR description contains instructions for the reviewer, if necessary.

🎯 Review Instructions

Review changes commit-by-commit.

I recommend only glancing at the second commit, as that shuffles around a lot of integration test reference data because of newly inserted calls to flush.

Code review should be almost trivial. Here's a high-level summary of the changes:

  • A new flush command plugin that adds a single command without options.
  • A new (atom::flush) -> void handler in the index that decommissions all active partitions.
  • The index_state::decommission_active_partition function now takes an optional completion handler so the flush command doesn't return too early.

@dominiklohmann dominiklohmann added the feature New functionality label Jul 2, 2022
@dominiklohmann dominiklohmann requested a review from a team July 2, 2022 11:17
@dominiklohmann dominiklohmann force-pushed the story/sc-34448/flush-command branch from 55d5186 to 42c802c Compare July 2, 2022 11:27
The new `flush` command causes VAST to decomission all currently active
partitions, i.e., write all active partitions to disk immediately regardless of
their size or the active partition timeout. This is particularly useful for
testing, or when needing to guarantee in automated scripts that input is
available for operations that only work on persisted passive partitions.

The flush command returns only after all active partitions were flushed to the
disk.
Explicit flushing after blocking imports makes many of our integration tests
more reliable, reducing the risk of timing-related failures.
@dominiklohmann dominiklohmann force-pushed the story/sc-34448/flush-command branch from f8ec492 to 6b52021 Compare July 2, 2022 17:24
@dominiklohmann dominiklohmann added blocked Blocked by an (external) issue and removed blocked Blocked by an (external) issue labels Jul 2, 2022
@dominiklohmann dominiklohmann requested review from lava and patszt and removed request for a team July 7, 2022 13:46
Copy link
Member

@lava lava left a comment

Choose a reason for hiding this comment

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

Thanks for implementing this! The completion parameter looks weird, but I wasn't able to come up with a better alternative after thinking about it for a while.

@dominiklohmann dominiklohmann enabled auto-merge July 8, 2022 09:18
@dominiklohmann dominiklohmann merged commit c28c759 into master Jul 8, 2022
@dominiklohmann dominiklohmann deleted the story/sc-34448/flush-command branch July 8, 2022 10:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants