fix: refactor walScanLogGetLastVer, walCheckAndRepairMeta, and walCheckAndRepairIdx.
* search for the last entry in the contiguous range of valid WAL from the last pos fsynced as firstTrial * find the last entry before the last pos fsynced backwards as second trial * reserve sufficient space for computing CRC32 checksum, esp. of WAL record body * rebuild meta info to resolve potential misalignment between lists of meta and actual log files * retract commitIndex and appliedIndex to lastLogIndex if needed * put an upper size limit on possibly corrupted WAL range to be recovered
Showing
想要评论请 注册 或 登录