EDOC-1021: do secondaryId cardinality test before set