Fix inode creation when /index/maxid is out of sync

This commit is contained in:
Vitaliy Filippov
2022-06-06 16:35:51 +03:00
parent 3b7c6dcac2
commit 1eec4407ab
3 changed files with 25 additions and 1 deletions
+2 -1
View File
@@ -276,7 +276,8 @@ resume_4:
new_id = 1+INODE_NO_POOL(kv.value.uint64_value());
max_id_mod_rev = kv.mod_revision;
}
auto ino_it = parent->cli->st_cli.inode_config.lower_bound(INODE_WITH_POOL(new_pool_id, 0));
// Also check existing inodes - for the case when some inodes are created without changing /index/maxid
auto ino_it = parent->cli->st_cli.inode_config.lower_bound(INODE_WITH_POOL(new_pool_id+1, 0));
if (ino_it != parent->cli->st_cli.inode_config.begin())
{
ino_it--;