zpoolがstate: FAULTEDした話

知見でもなんでもないが、記録のために。

TL;DR

  • 寝ている間にストレージサーバがpanicした。
  • 自動再起動したが、zpoolがFAULTEDとなっていた。
  • 5秒分のデータを失ってもいいならimportできるよ、という親切なメッセージが出た。
  • zpool import -Fだけで無事直った。

まずpanicした。これは起きてほしくはないが、仕方がない。
とくにこれといった特徴はない。

kernel trap 12 with interrupts disabled

Fatal trap 12: page fault while in kernel mode
cpuid = 0; apic id = 00
fault virtual address = 0xfffffe0011e246f0
fault code            = supervisor read data, page not present
instruction pointer   = 0x20:0xffffffff80c393f4
stack pointer         = 0x28:0xfffffe0084ef2800
frame pointer         = 0x28:0xfffffe0084ef2800
code segment          = base 0x0, limit 0xfffff, type 0x1b
                      = DPL 0, pres 1, long 1, def32 0, gran 1
processor eflags      = resume, IOPL = 0
current process               = 4 (doneq0)
trap number           = 12

The pool metadata is corrupted とか怖いことを言われる。

# zpool import                                                           
                                                                                          
   pool: sakura                                                                           
     id: 16271490741989414414                                                             
  state: FAULTED
status: The pool metadata is corrupted.
 action: The pool cannot be imported due to damaged devices or data.                      
        The pool may be active on another system, but can be imported using               
        the '-f' flag.                                                                    
   see: https://openzfs.github.io/openzfs-docs/msg/ZFS-8000-72                            
 config:                                                                                  
                                                                                          
        sakura                    FAULTED  corrupted data                                 
          raidz1-0                ONLINE                                                  
            gpt/sakura-1          ONLINE                                                  
            gpt/sakura-2          ONLINE                                                  
            gpt/sakura-3          ONLINE  

恐る恐るimportしようとすると、拒否はされるが、5秒分のデータを失っていいなら zpool import -F でいけるよ、と教えてくれる。

# zpool import sakura        
cannot import 'sakura': I/O error                                                         
        Recovery is possible, but will result in some data loss.                          
        Returning the pool to its state as of Fri Dec 16 00:33:39 2022                    
        should correct the problem.  Approximately 5 seconds of data                      
        must be discarded, irreversibly.  Recovery can be attempted                       
        by executing 'zpool import -F sakura'.  A scrub of the pool                       
        is strongly recommended after recovery.                                                                                                                                      

というわけで zpool import -F を実行して、無事 HEALTHY に回復。
recommendation通りに zpool scrub も実行。これもなにもエラーを検出せずで、ひと安心。

5秒分のロス程度なら、自動で復旧してくれて構わない気もするが、そういう設定があるかは調べていない。
また起きたら考えるつもり。