A bunch of stuff for data sync, and some for metadata sync retries

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>