Commit 4e1b1f74 authored by Oleg Ponomarev's avatar Oleg Ponomarev Committed by Klaus Aehlig

Add test showing a bug in location score calculation

The bug is using incorrect location score during failover and replace
action. Thus the idea of the test is to introduce a situation in which
it's profitably to perform failover and replace move in order to
optimize cluster score (if ignoring location tags). Considering location
tags another final placement is optimal.

In this test the optimal placement should locate primary instances to
nodes 1 and 3 with secondaries on the second node.
Signed-off-by: default avatarOleg Ponomarev <onponomarev@gmail.com>
Signed-off-by: default avatarKlaus Aehlig <aehlig@google.com>
Reviewed-by: default avatarKlaus Aehlig <aehlig@google.com>
parent fb0c774b
......@@ -1668,6 +1668,7 @@ TEST_FILES = \
test/data/htools/hbal-excl-tags.data \
test/data/htools/hbal-forth.data \
test/data/htools/hbal-location-1.data \
test/data/htools/hbal-location-2.data \
test/data/htools/hbal-migration-1.data \
test/data/htools/hbal-migration-2.data \
test/data/htools/hbal-migration-3.data \
......
group-01|fake-uuid-01|preferred||
node-01|16384|0|15360|409600|306600|16|N|fake-uuid-01|1|power:a,power:c
node-02|2048|0|1024|109600|6600|16|N|fake-uuid-01|1|power:b
node-03|2048|0|2048|409600|409600|16|N|fake-uuid-01|1|power:a,power:c
inst1|1024|51200|1|running|Y|node-01|node-02|drbd||1
inst2|1024|51200|1|running|Y|node-02|node-01|drbd||1
htools:nlocation:power
......@@ -25,7 +25,14 @@
node-04 0/
>>>= 0
./test/hs/hbal -t $TESTDATA_DIR/hbal-location-1.data
>>>/Solution length=[1-9]/
>>>= 0
./test/hs/hbal --print-nodes=name,pcnt -t $TESTDATA_DIR/hbal-location-2.data
>>>2/Final cluster status:
Name pcnt
node-01 1
node-02 0
node-03 1/
>>>= 0
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment