jcarreira / cirrus-kv

High-performance key-value store

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Concurrency bug when doing async RDMA reads

jcarreira opened this issue · comments

Successive async reads can end up writing to the same memory address. This can lead to buggy reads.

The same bug also exists with async writes.

This bug can be replicated by running the iterator test in the iterator branch.

This bug occurs because data from every read_async[1], is always copied to the same RDMA pinned part of memory and then asynchronously written to remote memory.

Two quick enough async reads will result in reads to the same local memory.

Solution:

  1. A quick solution to this is to pin/unpin memory every time there is a read.
  2. An alternative solution is to copy the data to the pinned region. This would mean we would have to manage the pinned memory. We can use the boost allocator that we already use on the server side for this.

[1] Actually only those that do not have an RDMAMem as an argument

Fixed this by going with option 1) PR #41