I have an NFS mount from a linux client to a linux NFS server using a
soft mount.

I have a program that is writing to a file on that share, correctly
checking for return values and after each write calls fsync. It also
logs each message with a unique increasing transaction ID.

When I reboot my NFS server, my client application does not see any
error and fsync continues to return success. When the NFS server
comes back up, the writes keep going through, but all the writes that
were issued while the NFS server was down is lost.

How do I detect that the writes are actually NOT succeeding?