On Mon, Jan 4, 2021 at 5:09 PM Bob Peterson <[email protected]> wrote: > > Hi, > > ----- Original Message ----- > > Hi, > > > > On 22/12/2020 20:38, Bob Peterson wrote: > > > Hi, > > > > > > Before this patch, journal recovery was done by a workqueue function that > > > operated on a per-journal basis. The problem is, these could run > > > simultaneously > > > which meant that they could all use the same bio, sd_log_bio, to do their > > > writing to all the various journals. These operations overwrote one > > > another > > > eventually causing memory corruption. > > > > Why not just add more bios so that this issue goes away? It would make > > more sense than preventing recovery from running in parallel. In general > > recovery should be spread amoung nodes anyway, so the case of having > > multiple recoveries running on the same node in parallel should be > > fairly rare too, > > > > Steve. > > As I understand it, if we allocate a bio from the same bio_set (as bio_alloc > does) > we need to submit the previous bio before getting the next one, which means > recovery processes cannot work in parallel, even if they use different bio > pointers.
Each recovery worker submits the current bio before allocating the next, so in the worst possible case, the recovery workers will end up getting serialized (that is, they will sleep in bio_alloc until they get their turn). Andreas
