TiFlash may fail to start if fstat got stuck on NFS devices
Open
Nobody has claimed this yet.
type/enhancement
- Dominant language
- C++
- Stars
- 1k
- Forks
- 423
- Avg merge
- 1d 15h
- Merged PRs (30d)
- 24
Description
Enhancement
Will call fn_server_info at beginning
fn disk_hardware_info(collector: &mut Vec<ServerInfoItem>) {
let mut system = SYS_INFO.lock().unwrap();
system.refresh_disks_list();
system.refresh_disks();
let disks = system.get_disks();
for disk in disks {
let file_sys = std::str::from_utf8(disk.get_file_system()).unwrap_or("unknown");
...
Which is
fn new_disk(name: &OsStr, mount_point: &Path, file_system: &[u8]) -> Option<Disk> {
let mount_point_cpath = utils::to_cpath(mount_point);
let type_ = find_type_for_name(name);
let mut total = 0;
let mut available = 0;
unsafe {
let mut stat: statvfs = mem::zeroed();
if statvfs(mount_point_cpath.as_ptr() as *const _, &mut stat) == 0 {
total = cast!(stat.f_bsize) * cast!(stat.f_blocks);
available = cast!(stat.f_bsize) * cast!(stat.f_bavail);
}
}
...
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the startup path to fn_server_info and disk_hardware_info, then inspect new_disk and its statvfs call. Reproduce or reason about startup with an NFS mount that blocks filesystem statistics; done means TiFlash can start without hanging on that device.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100