tarantool / vshard

The new generation of sharding based on virtual buckets
Other
100 stars 30 forks source link

Fix rebalancer stress tests flakiness #354

Closed Gerold103 closed 2 years ago

Gerold103 commented 2 years ago

See the commit messages. Here is an example of what I am talking about in the first commit:

net = require('net.box')
fiber = require('fiber')
box.cfg{listen = 3313}
box.schema.user.grant('guest', 'super')
count = 0
c = net.connect(box.cfg.listen)
c:eval('return 1')

f = fiber.new(function()
    fiber.self():set_joinable(true)
    local cancel_count = 10
    while pcall(fiber.testcancel) do
        pcall(fiber.sleep, 0.01)
    end
    return pcall(c.eval, c, 'count = count + 1')
end)

fiber.sleep(0.1)
f:cancel()
f:join()

Then print count and you will see 1. The request in a cancelled fiber was saved into netbox's buffer. Only the waiting for response failed. But the request was sent.

I run both stress tests 60 times locally, the error seems to be gone from both.

309