Epoch alignment in stateful streams