Compare commits
2 Commits
fbf0263625
...
f245b56176
Author | SHA1 | Date |
---|---|---|
Vitaliy Filippov | f245b56176 | |
Vitaliy Filippov | befca06f18 |
|
@ -169,46 +169,48 @@ void cluster_client_t::calc_wait(cluster_op_t *op)
|
||||||
|
|
||||||
void cluster_client_t::inc_wait(uint64_t opcode, uint64_t flags, cluster_op_t *next, int inc)
|
void cluster_client_t::inc_wait(uint64_t opcode, uint64_t flags, cluster_op_t *next, int inc)
|
||||||
{
|
{
|
||||||
if (opcode == OSD_OP_WRITE)
|
if (opcode != OSD_OP_WRITE && opcode != OSD_OP_SYNC)
|
||||||
{
|
{
|
||||||
while (next)
|
return;
|
||||||
{
|
|
||||||
auto n2 = next->next;
|
|
||||||
if (next->opcode == OSD_OP_SYNC && (!(flags & OP_IMMEDIATE_COMMIT) || enable_writeback) ||
|
|
||||||
next->opcode == OSD_OP_WRITE && (flags & OP_FLUSH_BUFFER) && !(next->flags & OP_FLUSH_BUFFER))
|
|
||||||
{
|
|
||||||
next->prev_wait += inc;
|
|
||||||
assert(next->prev_wait >= 0);
|
|
||||||
if (!next->prev_wait)
|
|
||||||
{
|
|
||||||
if (next->opcode == OSD_OP_SYNC)
|
|
||||||
continue_sync(next);
|
|
||||||
else
|
|
||||||
continue_rw(next);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
next = n2;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else if (opcode == OSD_OP_SYNC)
|
cluster_op_t *bh_ops_local[32], **bh_ops = bh_ops_local;
|
||||||
|
int bh_op_count = 0, bh_op_max = 32;
|
||||||
|
while (next)
|
||||||
{
|
{
|
||||||
while (next)
|
auto n2 = next->next;
|
||||||
|
if (opcode == OSD_OP_WRITE
|
||||||
|
? (next->opcode == OSD_OP_SYNC && (!(flags & OP_IMMEDIATE_COMMIT) || enable_writeback) ||
|
||||||
|
next->opcode == OSD_OP_WRITE && (flags & OP_FLUSH_BUFFER) && !(next->flags & OP_FLUSH_BUFFER))
|
||||||
|
: (next->opcode == OSD_OP_SYNC || next->opcode == OSD_OP_WRITE))
|
||||||
{
|
{
|
||||||
auto n2 = next->next;
|
next->prev_wait += inc;
|
||||||
if (next->opcode == OSD_OP_SYNC || next->opcode == OSD_OP_WRITE)
|
assert(next->prev_wait >= 0);
|
||||||
|
if (!next->prev_wait)
|
||||||
{
|
{
|
||||||
next->prev_wait += inc;
|
// Kind of std::vector with local "small vector optimisation"
|
||||||
assert(next->prev_wait >= 0);
|
if (bh_op_count >= bh_op_max)
|
||||||
if (!next->prev_wait)
|
|
||||||
{
|
{
|
||||||
if (next->opcode == OSD_OP_SYNC)
|
bh_op_max *= 2;
|
||||||
continue_sync(next);
|
cluster_op_t **n = (cluster_op_t**)malloc_or_die(sizeof(cluster_op_t*) * bh_op_max);
|
||||||
else
|
memcpy(n, bh_ops, sizeof(cluster_op_t*) * bh_op_count);
|
||||||
continue_rw(next);
|
bh_ops = n;
|
||||||
}
|
}
|
||||||
|
bh_ops[bh_op_count++] = next;
|
||||||
}
|
}
|
||||||
next = n2;
|
|
||||||
}
|
}
|
||||||
|
next = n2;
|
||||||
|
}
|
||||||
|
for (int i = 0; i < bh_op_count; i++)
|
||||||
|
{
|
||||||
|
cluster_op_t *next = bh_ops[i];
|
||||||
|
if (next->opcode == OSD_OP_SYNC)
|
||||||
|
continue_sync(next);
|
||||||
|
else
|
||||||
|
continue_rw(next);
|
||||||
|
}
|
||||||
|
if (bh_ops != bh_ops_local)
|
||||||
|
{
|
||||||
|
free(bh_ops);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,7 @@ if [[ "$SCHEME" = "ec" ]]; then
|
||||||
PG_DATA_SIZE=${PG_DATA_SIZE:-2}
|
PG_DATA_SIZE=${PG_DATA_SIZE:-2}
|
||||||
PG_MINSIZE=${PG_MINSIZE:-3}
|
PG_MINSIZE=${PG_MINSIZE:-3}
|
||||||
fi
|
fi
|
||||||
OSD_COUNT=7
|
OSD_COUNT=${OSD_COUNT:-7}
|
||||||
PG_COUNT=32
|
PG_COUNT=32
|
||||||
. `dirname $0`/run_3osds.sh
|
. `dirname $0`/run_3osds.sh
|
||||||
check_qemu
|
check_qemu
|
||||||
|
@ -29,7 +29,7 @@ kill_osds()
|
||||||
kill -9 $OSD1_PID
|
kill -9 $OSD1_PID
|
||||||
$ETCDCTL del /vitastor/osd/state/1
|
$ETCDCTL del /vitastor/osd/state/1
|
||||||
|
|
||||||
for i in 2 3 4 5 6 7; do
|
for i in $(seq 2 $OSD_COUNT); do
|
||||||
sleep 15
|
sleep 15
|
||||||
echo Killing OSD $i and starting OSD $((i-1))
|
echo Killing OSD $i and starting OSD $((i-1))
|
||||||
p=OSD${i}_PID
|
p=OSD${i}_PID
|
||||||
|
@ -40,8 +40,8 @@ kill_osds()
|
||||||
done
|
done
|
||||||
|
|
||||||
sleep 5
|
sleep 5
|
||||||
echo Starting OSD 7
|
echo Starting OSD $OSD_COUNT
|
||||||
start_osd 7
|
start_osd $OSD_COUNT
|
||||||
|
|
||||||
sleep 5
|
sleep 5
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue