Bug 259611 - [smartpqi] file system checksum on blocks give errors on higher parallel loads
Summary: [smartpqi] file system checksum on blocks give errors on higher parallel loads
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: 13.0-STABLE
Hardware: amd64 Any
: --- Affects Only Me
Assignee: freebsd-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-11-02 14:08 UTC by Palle Girgensohn
Modified: 2023-10-19 03:25 UTC (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Palle Girgensohn freebsd_committer freebsd_triage 2021-11-02 14:08:27 UTC
Hi!

I also have problems with this controller. With 13.0 installed, it crashed quite quickly on just IO intermediate load. After upgrading to -STABLE on October 12 2021, the system is quite stable, BUT, when restoring postgresql databases with pg_restore -j 5 (five writes in parallel), the database later reports checksum errors when reading some blocks back.

This seems to happen mainly for big database indexes that where generated in parallel.

I didn't notice until I took a pg_basebackup because postgresql does not validate the checksum until it is read.

Sorry, lots of database methods, not necessarily common knowledge for scsi experts. A pg_basebackup basically copies all the files, quite similar to an rsync, but optiionally also validates a CRC checksum, that was calculated for each block was they where written, as it reads the data

pg_restore reads a database dumps, writes all the data to disk and creates the indexes using sql create index commands, that is, looking the written files and calculates the index and writes them.

For about 1,3 TB of database data, the system had 2324 blocks with checksum errors. All but two of them where with indexes, which kind of suggest that this *could* be a postgresql issue, but given the amount of users using postgresql as opposed to the amount of users using this controller with freebsd, I'm reluctant to discredit postgresql here. We should have heard of it if there was a problem with postgresql?

Since most errors where with the indexes, they could be reindexed, and the one data table that was broken, I managed to fix, so at the moment my data seems to be safe, but I do not trust this controller-driver-OS combo much at the moment. 

Anything I can do to help find a solution to the problem? I'm considering moving the databases back to an old "trusted" box, so if it could help, I could perhaps supply you with a login to the box in a week or so? Would that help? It has an ILO for remote console as well.

I am using the built in RAID:

$ dmesg |grep -i smart
smartpqi0: <P408i-a SR Gen10> port 0x8000-0x80ff mem 0xe6c00000-0xe6c07fff at device 0.0 numa-domain 0 on pci9
smartpqi0: using MSI-X interrupts (32 vectors)
da0 at smartpqi0 bus 0 scbus0 target 0 lun 1
da1 at smartpqi0 bus 0 scbus0 target 0 lun 2
ses0 at smartpqi0 bus 0 scbus0 target 72 lun 0
ses0: <HPE Smart Adapter 3.53> Fixed Enclosure Services SPC-3 SCSI device
pass3 at smartpqi0 bus 0 scbus0 target 1088 lun 1

$ sudo camcontrol devlist
<HPE RAID 1(1+0) OK>               at scbus0 target 0 lun 1 (pass0,da0)
<HPE RAID 1(1+0) OK>               at scbus0 target 0 lun 2 (pass1,da1)
<HPE Smart Adapter 3.53>           at scbus0 target 72 lun 0 (ses0,pass2)
<HPE P408i-a SR Gen10 3.53>        at scbus0 target 1088 lun 1 (pass3)
<Generic- SD/MMC CRW 1.00>         at scbus1 target 0 lun 0 (da2,pass4)

I use the UFS filesystem.

Regards,
Palle
Comment 1 Graham Perrin freebsd_committer freebsd_triage 2021-11-05 02:15:02 UTC
(In reply to Palle Girgensohn from comment #0)

How is the file system tuned? E.g. 

tunefs -p /
Comment 2 Palle Girgensohn freebsd_committer freebsd_triage 2021-11-10 16:52:45 UTC
(In reply to Graham Perrin from comment #1)

$ tunefs -p /
tunefs: POSIX.1e ACLs: (-a)                                disabled
tunefs: NFSv4 ACLs: (-N)                                   disabled
tunefs: MAC multilabel: (-l)                               disabled
tunefs: soft updates: (-n)                                 enabled
tunefs: soft update journaling: (-j)                       enabled
tunefs: gjournal: (-J)                                     disabled
tunefs: trim: (-t)                                         disabled
tunefs: maximum blocks per file in a cylinder group: (-e)  4096
tunefs: average file size: (-f)                            16384
tunefs: average number of files in a directory: (-s)       64
tunefs: minimum percentage of free space: (-m)             8%
tunefs: space to hold for metadata blocks: (-k)            6400
tunefs: optimization preference: (-o)                      time
tunefs: volume label: (-L)
Comment 3 Palle Girgensohn freebsd_committer freebsd_triage 2022-01-25 09:13:01 UTC
The version in stable at present still gives bad checksums during high load (see bug #259611). Suggestion in bug #256603 is to use the binary distribution, latest version in https://storage.microsemi.com/en-us/downloads/unix/freebsd/productid=aha-2100-8i&dn=microsemi+adaptec+smarthba+2100-8i.php 

Will try this and see if it is better. 

Data corruption does not happen a lot unless it is provoked by high load, but we did see about a 100 bad blocks in a file. For a database machine, this could be a terrible problem. So far we've been able to mend the data using backups.
Comment 4 Hermes T K 2022-01-27 11:11:54 UTC
This seems to be similar with Bug 240145(https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=240145).
Can you please try with attached smartpqi bootleg driver in comment 79 of  Bug 240145 ?
Smartpqi latest production driver will be released in another 2 weeks.


Thanks & Regards
Hermes T K
Comment 5 Warner Losh freebsd_committer freebsd_triage 2023-10-19 03:09:04 UTC
Does this happen with main, stable/14 or one of the 14.0 release candidates / betas? I think it can be closed.
Comment 6 Warner Losh freebsd_committer freebsd_triage 2023-10-19 03:25:54 UTC
Ah, this has been fixed with the latest driver.
Please open a new bug should that driver still have a similar issue.