In our application we use Hibernate and PostgreSQL to store data. In one of our database tables we have a discriminator column which says for example "TIPPSPIEL". It is a fixed string and can not be manipulated by any user.
Suddenly we had one entry in this huge table where we had "TIPPQPIEL" instead of "TIPPSPIEL". We have no clue how this can happen.
Is it possible by any means that our hard disk is switching one bit, so our letter "S" is no longer encoded as "1010001" but suddenly becomes a "Q" on the hard disk with one bit switched like this: 1010011?
I am not an expert on hard disk an bit physics but I guess an OS or a disk has checksums and other stuff to ensure that this can't happen.
Is it possible that just one bit switches so my file shows me a letter "Q" instead of a "S"?
UPDATE: We made further analyse. Our slave database gets its WAL Records from master (PostgreSQL feature). Whatever: our slave server should be in sync. But the slave wasn't in sync regarding this particular row. We could see that it happened a few days ago without any interaction from a user on this particular entry. So it MUST be a bit flipping around. scary!
It's so rare we see a genuinely interesting question on this site, so thank you first of all.
I think what you're seeing there is indeed a single-bit error, amazing you could spot it to be honest but you're correct in assuming that the second-least-significant-bit has been switched (assuming you're using ASCII anyway).
As for checksums etc. when it was written to the disk it's likely it will have been verified as fine - I'm pretty sure this problem has developed afterwards via a simple magnetic-leakage error. But you're right, there are encoding checks done, it varies from manufacturer but there's probably a error somewhere saying 'this looks a bit odd' - but what option does your IO chain have available? deny you the whole block? I'm going to assume this is a single non-RAIDed disk as they RAIDed disks tend to have more options available to them when they detect errors.
It's an odd one, though this kind of thing probably happened multiple times a second across the world.