Commit b6aa3898 authored by Matthieu Dorier's avatar Matthieu Dorier

corrected bug

parent 042e0d27
......@@ -89,6 +89,7 @@ int main(int argc, char** argv)
}
remi_fileset_register_metadata(fileset, "AERED", "qerqwer");
remi_fileset_set_xfer_size(fileset, 4);
// migrate the fileset
int status = 0;
ret = remi_fileset_migrate(remi_ph, fileset, remote_root, REMI_KEEP_SOURCE, REMI_USE_ABTIO, &status);
......
......@@ -429,8 +429,6 @@ int migrate_using_abtio(
current_chunk_size = remaining_size < max_chunk_size ? remaining_size : max_chunk_size;
current_buffer.resize(current_chunk_size);
auto sizeRead = abt_io_pread(abtio, fd, &current_buffer[0], current_chunk_size, current_chunk_offset);
current_chunk_offset += current_chunk_size;
remaining_size -= current_chunk_size;
}
// wait for the RPC to finish
ret = async_req.wait();
......@@ -439,6 +437,8 @@ int migrate_using_abtio(
if(!can_stop) {
previous_chunk_offset = current_chunk_offset;
previous_chunk_size = current_chunk_size;
current_chunk_offset += current_chunk_size;
remaining_size -= current_chunk_size;
std::swap(current_buffer, previous_buffer);
}
}
......
......@@ -329,7 +329,7 @@ struct remi_provider : public tl::provider<remi_provider> {
int fd = op.m_fds[fileNumber];
ssize_t s;
{ // only HDDs will be locked to avoid concurrent writes
std::lock_guard<device>(*(op.m_devices[fileNumber]));
std::lock_guard<device> guard(*(op.m_devices[fileNumber]));
// send an early response so the client can start sending the next chunk
// in parallel while this chunk is being written
......@@ -341,11 +341,11 @@ struct remi_provider : public tl::provider<remi_provider> {
} else {
s = abt_io_pwrite(m_abtio, fd, data.data(), data.size(), writeOffset);
}
}
if(s != data.size()) {
op.m_error = REMI_ERR_IO;
}
}
return;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment