Thanks for the review. Unfortunately I misunderstood the design
document. I'll resend new patch set soon.
On 13.07.2015 14:54, Klaus Aehlig wrote:
+-- | Check if move is allowed in terms of avoid disk moves factor
+isMoveAllowed :: IMove -- ^ Move to check
+ -> Double -- ^ Avoid disk moves factor (see algDiskMovesFactor)
+ -> Table -- ^ The original table
+ -> Table -- ^ The final table
+ -> Bool -- ^ Is move allowd or not
+isMoveAllowed Failover _ _ _ = True -- No disk moves in this case.
+isMoveAllowed _ factor (Table _ _ a_cv _) (Table _ _ b_cv _) =
+ a_cv > b_cv * factor
+-- Disk move is allowed it results in score that is factor times lower.
+
There are a couple of problems with this approach
- the specification talks about the gain, not the absolut value of the cluster
scores.
- you're basically modifying the comparison function that is folded to find
the minimum. This means, your comparing disk moves to whatever has been
the best move before
- in this arbitrary search order,
- be it another disk move or not.
This is not what is specified either.
- Failover is not the only non-disk move. Think about shared/external storage
and failover-to-any.
--
Sincerely, Oleg Ponomarev <[email protected]>