Skip to content
This repository has been archived by the owner on Jul 7, 2022. It is now read-only.

Commit

Permalink
Fixes issue with local short circuit (memcpy) path in the RDMA storage
Browse files Browse the repository at this point in the history
tier
- mmaped buffers were previously indexed with wrong LBA in
  RdmaStorageLocalEndpoint

This fixes the CRAIL-3 JIRA ticket
https://issues.apache.org/jira/browse/CRAIL-3

Close #8

Signed-off-by: Patrick Stuedi <pstuedi@apache.org>
Signed-off-by: Adrian Schuepbach <asq@apache.org>
  • Loading branch information
patrickstuedi authored and asqasq committed Feb 28, 2018
1 parent 8f81281 commit baab8d0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public class CrailConstants {
private static final Logger LOG = CrailUtils.getLogger();

public static final String VERSION_KEY = "crail.version";
public static int VERSION = 3003;
public static int VERSION = 3004;

public static final String DIRECTORY_DEPTH_KEY = "crail.directorydepth";
public static int DIRECTORY_DEPTH = 16;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,10 @@ public RdmaStorageLocalEndpoint(InetSocketAddress datanodeAddr) throws Exception
this.address = datanodeAddr;
this.bufferMap = new ConcurrentHashMap<Long, CrailBuffer>();
this.unsafe = getUnsafe();
long lba = 0;
for (File dataFile : dataDir.listFiles()) {
MappedByteBuffer mappedBuffer = mmap(dataFile);
bufferMap.put(lba, OffHeapBuffer.wrap(mappedBuffer));
lba += mappedBuffer.capacity();
long lba = Long.parseLong(dataFile.getName());
OffHeapBuffer offHeapBuffer = OffHeapBuffer.wrap(mmap(dataFile));
bufferMap.put(lba, offHeapBuffer);
}
}

Expand Down Expand Up @@ -134,7 +133,7 @@ public StorageFuture read(CrailBuffer buffer, BlockInfo remoteMr, long remoteOff
}

private static long getAlignedLba(long remoteLba){
return (remoteLba / RdmaConstants.STORAGE_RDMA_ALLOCATION_SIZE) * RdmaConstants.STORAGE_RDMA_ALLOCATION_SIZE;
return remoteLba / RdmaConstants.STORAGE_RDMA_ALLOCATION_SIZE;
}

private static long getLbaOffset(long remoteLba){
Expand Down

0 comments on commit baab8d0

Please sign in to comment.