dbms: Server: feature development. [#METR-15090]

This commit is contained in:
Alexey Arno 2015-03-06 17:45:14 +03:00
parent cdfb096f8f
commit 3459fdc01e
2 changed files with 3 additions and 1 deletions

View File

@ -43,6 +43,7 @@ private:
iocb cb;
std::vector<iocb *> request_ptrs;
std::vector<io_event> events;
size_t total_bytes_written = 0;
int fd = -1; // file descriptor
bool is_pending_write = false;
bool got_exception = false;

View File

@ -91,7 +91,7 @@ void WriteBufferAIO::nextImpl()
cb.aio_fildes = fd;
cb.aio_buf = reinterpret_cast<UInt64>(flush_buffer.buffer().begin());
cb.aio_nbytes = flush_buffer.offset();
cb.aio_offset = 0;
cb.aio_offset = total_bytes_written;
cb.aio_reqprio = 0;
if ((cb.aio_nbytes % BLOCK_SIZE) != 0)
@ -130,6 +130,7 @@ void WriteBufferAIO::waitForCompletion()
got_exception = true;
throw Exception("Asynchronous write error on file " + filename, ErrorCodes::AIO_WRITE_ERROR);
}
total_bytes_written += bytes_written;
is_pending_write = false;
}