Stop K/V listings at the end of their range #111

Closed
koolkhel wants to merge 2 commits from koolkhel/vitastor:kv-list-end into master

2 Commits

Author SHA1 Message Date
Yury Luneff
c3303a4122 Stop NFS prefix scans at the end of the prefix
The emptiness checks of RMDIR and of RENAME over a directory, READDIR
and the defrag scans list a key prefix. They now stop at the end of the
prefix instead of running on to the next existing key through blocks
emptied by deletes, which made RMDIR slower with every deleted file.

This also fixes RENAME of a directory over an empty directory failing
with ENOTEMPTY: its check took the first key after the prefix, which
belongs to another directory or inode, for an entry.
2026-10-27 10:15:27 +03:00
Yury Luneff
bf89e7e0d2 Add an end key to K/V listings
A listing goes on from block to block until it finds a key, and blocks
emptied by deletes are never freed. So a listing that runs past the end
of its range reads every empty block up to the next existing key, each
with a version check on an OSD. After many creates and deletes, this
made a single RMDIR in the NFS proxy take hundreds of milliseconds.

list_start(start, end) stops at the first key >= end and does not read
blocks beyond it. vitastor-kv list/dump/dumpjson now pass their end
argument.
2026-10-27 10:15:27 +03:00