sheep: remove redundant dprintf in do_local_io()

Both do_io_request and do_gateway_request already printf the info as follows:

...
Jun 20 19:43:03 [main] queue_request(312) 2
Jun 20 19:43:03 [io 3] do_io_request(105) 2, fd34af00000000 , 1
Jun 20 19:43:03 [io 3] do_local_io(52) 2, fd34af00000000 , 1

So remove it.

Signed-off-by: Liu Yuan <tailai.ly@taobao.com>
collie: fix vdi check command

- use memcmp directly to cmpare the content of object
- compare all the replica

Signed-off-by: Liu Yuan <tailai.ly@taobao.com>
sheep: use xwrite to avoid short write

Also add one liner to emphasis that we piggyback the ctime onto epoch file

Signed-off-by: Liu Yuan <tailai.ly@taobao.com>
sheep: fix local_get_epoch()

We should also add the piggybacked ctime to the length

Signed-off-by: Liu Yuan <tailai.ly@taobao.com>
recovery: fix a bug of get_vnode_info_epoch() which gives a bad node number

When local epoch file does not exist, sheep tries to read from remote node
by epoch_log_read_remote(), which directly returns the number of node, not
the length of node data.

Signed-off-by: levin li <xingke.lwp@taobao.com>
Signed-off-by: Liu Yuan <tailai.ly@taobao.com>
sheep: avoid calling delete_inode() in main thread

When deleting vdi, delete_one_done() calls delete_inode() which
do IO request (read and write), while delete_one_done() is called
in main thread, so we should not call delete_inode() in
delete_one_done().

Signed-off-by: levin li <xingke.lwp@taobao.com>
Signed-off-by: Liu Yuan <tailai.ly@taobao.com>
sheep: redesign a new cached sockfd pool

Old sockfd pool has following defect:
 0 statically allocated.
 1 use too many fds per sheep, not scalable 
 2 implemented per thread, can't be shared between threads
 3 need resetting at every membership change

The new sockfd cache aims to address these problems yet remain as effecient as
old one:
 0 dynamically allocated/deallocated at node granularity.
 1 cached fds are multiplexed by all threads.
 2 each session (for e.g, forward_write_obj_req) can grab one fd at a time
 3 if there isn't any FD available from cache, use normal connect_to() and close()
   internally
 4 FD are named by IP:PORT uniquely, hence no need of resetting at membership
   change
 5 the total number of FDs shrinks from (nr_gateway + nr_io) * nr_nodes to nr_nodes
 6 just add one more API, totally 3 APIs: sheep_{get,put,del}_fd()

Signed-off-by: Liu Yuan <tailai.ly@taobao.com>
sheep: use new sockfd cache

Signed-off-by: Liu Yuan <tailai.ly@taobao.com>
sheep, sockfd cache: cache more than one FD for each node

This is inspired by the observation that each Guest can issue as much
as 4 requests in one go.

The complexity added to the code is seen outside of sockfd cache: 
add one more parameter to the API: FD index. The underlying core needs this to
identify which FD belongs one node is actually used.

I think this trade-off is a good deal.

Signed-off-by: Liu Yuan <tailai.ly@taobao.com>
sheep: refactor forward_write_obj_req()
sheep: output hex for error code

Also we ask do_read() to dprintf 'ret' value instead of blindly print %m,
which looks wierd when remote node crashes (ret = 0)
sheep: try best forward_read_obj_req()

We should continue to read if one read fails, since we have strong consistency

Signed-off-by: Liu Yuan <tailai.ly@taobao.com>