Commit 01798a5c authored by adilr3's avatar adilr3
Browse files

more persistency stuff

parent 9e5607a2
......@@ -16,6 +16,13 @@
"slist": "cpp",
"ostream": "cpp",
"fstream": "cpp",
"istream": "cpp"
"istream": "cpp",
"array": "cpp",
"chrono": "cpp",
"functional": "cpp",
"ratio": "cpp",
"tuple": "cpp",
"type_traits": "cpp",
"utility": "cpp"
}
}
\ No newline at end of file
......@@ -148,6 +148,8 @@ HashTable::Entry::pack(uint64_t hash, bool chain, uint64_t ptr)
uint64_t c = chain ? 1 : 0;
assert((hash >> 16) == 0);
this->value = ((hash << 48) | (c << 47) | ptr);
flush(&(this->value),sizeof(uint64_t)); // need flush for persistency
}
/**
......
......@@ -470,21 +470,26 @@ ObjectManager::removeObject(Key& key, RejectRules* rejectRules,
appends[1].type = LOG_ENTRY_TYPE_RPCRESULT;
}
// flush added to append
if (!log.append(appends, (rpcResult ? 2 : 1))) {
// The log is out of space. Tell the client to retry and hope
// that the cleaner makes space soon.
return STATUS_RETRY;
}
if (rpcResult && rpcResultPtr)
if (rpcResult && rpcResultPtr){
*rpcResultPtr = appends[1].reference.toInteger();
flush(rpcResultPtr,sizeof(rpcResultPtr));
}
mfence();
TableStats::increment(masterTableMetadata,
tablet.tableId,
appends[0].buffer.size() + appends[1].buffer.size(),
rpcResult ? 2 : 1);
segmentManager.raiseSafeVersion(object.getVersion() + 1);
log.free(reference);
log.free(reference); //TODO: does this need a flush? if so, where
remove(lock, key);
return STATUS_OK;
}
......@@ -2173,6 +2178,7 @@ ObjectManager::flushEntriesToLog(Buffer *logBuffer, uint32_t& numEntries)
// persistency added
objectMap.insert(key.getHash(), references[i].toInteger());
}
mfence();
tabletManager->incrementWriteCount(key);
TableStats::increment(masterTableMetadata,
......
......@@ -1002,11 +1002,11 @@ Segment::Reference::getEntry(SegletAllocator* allocator,
}
if (lengthWithMetadata != NULL){
*lengthWithMetadata = fullLength;
// TODO: check whether needed
flush(
reinterpret_cast<void*>(reference),
fullLength
);
mfence();
}
return header->getType();
}
......
......@@ -35,6 +35,8 @@
#include "ObjectManager.h"
#include "PerfStats.h"
#include "Common.h"
namespace RAMCloud {
// Nodes in the B+ tree are stored as RAMCloud objects with the key being a
......
Supports Markdown
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