should be _xid, not xid
use amiprimary() to check whether the rsm is primary