Extends PlacementEngine.SelectPeerGroup with three new capabilities ported from jetstream_cluster.go:7212 selectPeerGroup: - JetStreamUniqueTag enforcement: PlacementPolicy.UniqueTag (e.g. "az") ensures no two replicas share the same value for a tag with that prefix, matching Go's uniqueTagPrefix / checkUniqueTag logic. - MaxAssetsPerPeer HA limit: peers at or above their asset ceiling are deprioritised (moved to fallback), not hard-excluded, so selection still succeeds when no preferred peers remain. - Weighted scoring: candidates sorted by score = AvailableStorage - (CurrentAssets * assetCostWeight) (DefaultAssetCostWeight = 1 GiB) replacing the raw-storage sort, with a custom weight parameter for testing. 10 new tests in TopologyPlacementTests.cs cover all three features and their edge cases. All 30 PlacementEngine tests continue to pass.
11 KiB
11 KiB