refine mysql replication stream handling