pub fn merge_and_validate_region_wal_options(
region_wal_options: &HashMap<RegionNumber, String>,
new_region_wal_options: HashMap<RegionNumber, String>,
new_region_routes: &[RegionRoute],
table_id: TableId,
) -> Result<HashMap<RegionNumber, String>>Expand description
Merges and validates region WAL options for repartition.
This function:
- Validates that new WAL options don’t overwrite existing ones
- Merges existing
region_wal_optionswith newnew_region_wal_options - Filters out WAL options for regions that are not in
new_region_routes - Validates that every region in
new_region_routeshas a corresponding WAL option
§Arguments
region_wal_options- Existing region WAL options from datanode tablenew_region_wal_options- New region WAL options to merge (should only contain newly allocated regions)new_region_routes- The new region routes after repartitiontable_id- Table ID for error reporting
§Returns
Returns the merged and filtered WAL options, ensuring all regions have options.
§Errors
Returns an error if:
- New WAL options try to overwrite existing ones for the same region
- Any region in
new_region_routesis missing a WAL option