Hi Nazir, On the entry count. Nothing is pinned in an IO worker, only the relcache calls smgrpin(), which also answers Alexandre's question. So the unpinned count is just hash_get_num_entries(), and that only reads a counter. SMgrRelationHash is local and not partitioned. The IO counter is fine with me too though.
One gap in v2. v1 cleaned up when the worker went idle, v2 does not. A worker that does fewer than 1024 IOs and then sleeps keeps those entries and their descriptors until it gets busy again. #19622 has that case, workers idle for 51 minutes still holding descriptors of dropped tables. Maybe also clean up in the idle branch when ios_since_smgr_cleanup > 0. That needs no lock either. Thanks, Shihao
