Skip to content

read hash mismatch panic should include more info #1924

@leftwo

Description

@leftwo

In upstairs/src/client.rs:1129 we have a panic if we get a read hash mismatch
The panic message shows us the client, and the job, but not the session ID, which will tell us what disk
it is that saw the problem:

                                let msg = format!(
                                    "[{}] read hash mismatch on {} \n\
                                        Expected {:x?}\n\
                                        Computed {:x?}\n\
                                        job: {:?}",
                                    self.client_id,
                                    ds_id,
                                    job_blocks,
                                    read_data.blocks,
                                    job,
                                );
                                if job.replay {
                                    info!(self.log, "REPLAY {msg}");
                                } else {
                                    panic!("{msg}");
                                }

A different case with read hash mismatch does include the session:

                    (IOop::Read { .. }, CrucibleError::HashMismatch) => {
                        panic!(     
                            "{} [{}] {} read hash mismatch {:?} {:?}",
                            self.cfg.session_id, self.client_id, ds_id, e, job
                        );
                    }  

I think both messages can be improved.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions