Thanks for writing the design @suresht
I have a doubt about your design.
You are making this so you have two different types of socket descriptors and the user of the IFL command needs to know which type to pass. Before we called pbs_connect(), got a socket descriptor, and used it. Now for the stat calls, you use the return from pbs_connect(). For non-sharded objects, I assume you still use that socket descriptor. For sharded objects, you need to use the socket descriptor of the server who owns the object. This is putting a large burden on the user of the API to know the internals of PBS.
You’ve taken a very easy to use API of pbs_connect(), IFL, IFL, IFL, pbs_disconnect(), to the user of the API needing to know which objects are sharded and which aren’t. If we ever want to shard another object, the user of the API would have to change how they use it once again.
This should be handled by PBS itself. Either have the servers forward the IFL request along to the right server, or have some sort of IFL daemon that sits in front of the IFL calls who knows who the forward the request to.