osd: query pool/pg for objects with given xattr
This will probably take the form of a pool class plugin?
It could start as just a hack, for now.
#5 Updated by Yehuda Sadeh about 10 years ago
The problem that I see is that this is going to be a very slow operation, and we need to figure out how not to timeout. One solution is that we return immediately with an 'operation token', and later on we can poll the osd with this token, so that we get the results that were accumulated in the mean time.
Another easier option, is just have it similar to a read-first - read-next sequence. The client first sends an initial request: pgcall-init, then the client sends pgcall-process(x) where x is the number of entries the client wants to go over. The osd then processes that amount of entries and only responds with the entries that weren't filtered out (can be an empty response). Then the client iterates over until everything is completed. This will be slower than the first solution, however, much simpler.
#7 Updated by Yehuda Sadeh about 10 years ago
- Status changed from New to Resolved
implemented it as a new PGLS_FILTER operation, but reuses the PGLS operation code. There's no class extension now, but in the future we might want to add that (once we have some more use cases).
The problem with creating new pg class methods is that they'll run in a different context than the current object class method, hence they'll require a different api. We think that at this point where we only have a single case we'd be better off just implementing the filtering option as a new op. In any case, we're passing enough parameters to the new op so that if we decide to implement a pg class mechanism, it'd be compatible.
Implemented in 1b0bb7a1e95da0de29adbbc57c2b299a66a19ee5
#9 Updated by Yehuda Sadeh about 10 years ago
yehudasa@skinny:~/ceph/src$ ./rados ls -p metadata --filter="parent 0x100"
dirino=100 dname=stray2 v=1
dirino=100 dname=stray6 v=1
dirino=100 dname=stray7 v=1
dirino=100 dname=stray3 v=1
dirino=100 dname=stray1 v=1
dirino=100 dname=stray0 v=1