UBERF-7682: Fix mongo cursor on backup (#6145)

Signed-off-by: Andrey Sobolev <haiodo@gmail.com>
This commit is contained in:
Andrey Sobolev 2024-07-26 12:36:01 +07:00 committed by Andrey Sobolev
parent 5f90d7821d
commit 068520b211
No known key found for this signature in database
GPG Key ID: BD80F68D68D8F7F2

View File

@ -845,6 +845,7 @@ abstract class MongoAdapterBase implements DbAdapter {
let d = await ctx.with('next', { mode }, async () => await iterator.next())
if (d == null && mode === 'hashed') {
mode = 'non-hashed'
await iterator.close()
iterator = coll.find({ '%hash%': { $in: ['', null] } })
d = await ctx.with('next', { mode }, async () => await iterator.next())
}