primary and secondary state in db