In my home state of North Carolina, the primaries are "open" in the sense that independent/unaffiliated voters may ask for either a Republican primary ballot or a Democratic primary ballot when they show up. The elections are still administered by the state in the same manner as general elections, so you only get to cast one ballot. There's no need for the state to record which ballot you asked for in order for you to be limited to voting in just one of the primaries, though they currently do so.
The primary ballots usually also have at least a few non-partisan local races, and if you don't want to participate in either primary you can simply ask for the ballot that has just those few questions on it.
Good point - I'd forgotten that the primaries are all run by the states, not by parties like the caucuses. So it doesn't matter if it's on one day or not, they should be able to have a master list of "has voted" that gets marked no matter which party ballot you submitted.
So, the only scenario where you need to know which primary they voted in is for states with an open primary that can also have a run-off election, which would give you the option of voting in a D primary first round and the R primary runoff if they didn't keep track (e.g Georgia has this system - https://www.wabe.org/party-matters-in-georgias-primary-runof...)