Commit 6683fe70 authored by Ramon Nou's avatar Ramon Nou
Browse files

fix(client): parse source_copy and target_copy as integers from repair journal

parent 7c7951ed
Loading
Loading
Loading
Loading
Loading
+8 −5
Changes for src/client/preload_context.cpp: 8 added lines, 5 removed lines.
Original line number Diff line number Diff line
@@ -1587,19 +1587,22 @@ PreloadContext::load_repair_journal() {
            continue;
        }
        gkfs::rpc::repair_task task;
        int source_copy = 0;
        int target_copy = 0;
        int kind = 0;
        int data_chunk = 0;
        int append = 0;
        int clear_inline = 0;
        std::istringstream record(line);
        if(!(record >> std::quoted(task.path) >> task.chunk_id >>
             task.source_copy >> task.target_copy >> task.generation >>
             task.retry_count >> task.last_error >> data_chunk >> kind >>
             task.mode >> task.size >> task.offset >> append >> clear_inline >>
             std::quoted(task.data))) {
        if(!(record >> std::quoted(task.path) >> task.chunk_id >> source_copy >>
             target_copy >> task.generation >> task.retry_count >>
             task.last_error >> data_chunk >> kind >> task.mode >> task.size >>
             task.offset >> append >> clear_inline >> std::quoted(task.data))) {
            LOG(WARNING, "Ignoring malformed replica repair journal record.");
            continue;
        }
        task.source_copy = static_cast<int8_t>(source_copy);
        task.target_copy = static_cast<int8_t>(target_copy);
        std::string trailing;
        if(record >> trailing) {
            LOG(WARNING,