Skip to content

Refactor FlushRegions in the meta Instruction #6016

Open
@MichaelScofield

Description

@MichaelScofield

Currently, the meta Instruction has both FlushRegions and FlushRegion.

#[derive(Debug, Clone, Serialize, Deserialize, Display, PartialEq)]
pub enum Instruction {
/// Opens a region.
///
/// - Returns true if a specified region exists.
OpenRegion(OpenRegion),
/// Closes a region.
///
/// - Returns true if a specified region does not exist.
CloseRegion(RegionIdent),
/// Upgrades a region.
UpgradeRegion(UpgradeRegion),
/// Downgrades a region.
DowngradeRegion(DowngradeRegion),
/// Invalidates batch cache.
InvalidateCaches(Vec<CacheIdent>),
/// Flushes regions.
FlushRegions(FlushRegions),
/// Flushes a single region.
FlushRegion(RegionId),
}

They are confusing.

FlushRegions works asynchronously and serves as a non-mandatory hint, while FlushRegion enforces a synchronous flush operation. We will later rename FlushRegions to FlushRegionsHint or FlushRegionsSuggestion to make its purpose clearer.

Originally posted by @WenyXu in #5995 (comment)

If possible, we can also refactor the two instructions and merge them into a single instruction.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-metasrvInvolves code in the meta servergood first issueGood for newcomers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions