Change the way the parts/size is updated, add a unique index to messageid.