MCPcopy Create free account
hub / github.com/apple/foundationdb / commit

Method commit

fdbserver/DiskQueue.actor.cpp:957–992  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

955 }
956
957 Future<Void> commit() override {
958 ASSERT(recovered);
959 if (!pushedPageCount()) {
960 if (!anyPopped)
961 return Void();
962 addEmptyPage(); // To remove poped pages, we push an empty page to specify that pages behind it were poped.
963 }
964 anyPopped = false;
965 backPage().popped = poppedSeq;
966 backPage().zeroPad();
967 backPage().updateHash();
968
969 // Warn users that we pushed too many pages. 8000 is an arbitrary value.
970 if (pushedPageCount() >= 8000) {
971 TraceEvent(warnAlwaysForMemory ? SevWarnAlways : SevWarn, "DiskQueueMemoryWarning", dbgid)
972 .suppressFor(1.0)
973 .detail("PushedPages", pushedPageCount())
974 .detail("NextPageSeq", nextPageSeq)
975 .detail("Details", format("%d pages", pushedPageCount()))
976 .detail("File0Name", rawQueue->files[0].dbgFilename);
977 if (g_network->isSimulated())
978 warnAlwaysForMemory = false;
979 }
980
981 /*TraceEvent("DQCommit", dbgid).detail("Pages", pushedPageCount()).detail("LastPoppedSeq", lastPoppedSeq).detail("PoppedSeq", poppedSeq).detail("NextPageSeq", nextPageSeq)
982 .detail("RawFile0Size", rawQueue->files[0].size).detail("RawFile1Size",
983 rawQueue->files[1].size).detail("WritingPos", rawQueue->writingPos) .detail("RawFile0Name",
984 rawQueue->files[0].dbgFilename);*/
985
986 lastCommittedSeq = backPage().endSeq();
987 auto f = rawQueue->pushAndCommit(
988 pushed_page_buffer->get(), pushed_page_buffer, poppedSeq / sizeof(Page) - lastPoppedSeq / sizeof(Page));
989 lastPoppedSeq = poppedSeq;
990 pushed_page_buffer = 0;
991 return f;
992 }
993
994 void stall() { rawQueue->stall(); }
995

Callers

nothing calls this directly

Calls 11

pushedPageCountFunction · 0.85
TraceEventClass · 0.85
zeroPadMethod · 0.80
updateHashMethod · 0.80
detailMethod · 0.80
endSeqMethod · 0.80
pushAndCommitMethod · 0.80
getMethod · 0.65
VoidClass · 0.50
formatFunction · 0.50
isSimulatedMethod · 0.45

Tested by

no test coverage detected