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

Function when

fdbserver/GetEncryptCipherKeys.actor.cpp:103–122  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

101 // Fetch any uncached cipher keys.
102 loop choose {
103 when(EKPGetLatestBaseCipherKeysReply reply = wait(getUncachedLatestEncryptCipherKeys(db, request))) {
104 // Insert base cipher keys into cache and construct result.
105 for (const EKPBaseCipherDetails& details : reply.baseCipherDetails) {
106 EncryptCipherDomainId domainId = details.encryptDomainId;
107 if (domains.count(domainId) > 0 && cipherKeys.count(domainId) == 0) {
108 Reference<BlobCipherKey> cipherKey = cipherKeyCache->insertCipherKey(
109 domainId, details.baseCipherId, details.baseCipherKey.begin(), details.baseCipherKey.size());
110 ASSERT(cipherKey.isValid());
111 cipherKeys[domainId] = cipherKey;
112 }
113 }
114 // Check for any missing cipher keys.
115 for (auto& domain : request.encryptDomainInfos) {
116 if (cipherKeys.count(domain.domainId) == 0) {
117 TraceEvent(SevWarn, "GetLatestEncryptCipherKeys_KeyMissing").detail("DomainId", domain.domainId);
118 throw encrypt_key_not_found();
119 }
120 }
121 break;
122 }
123 // In case encryptKeyProxy has changed, retry the request.
124 when(wait(onEncryptKeyProxyChange(db))) {}
125 }

Callers

nothing calls this directly

Calls 9

TraceEventClass · 0.85
insertCipherKeyMethod · 0.80
detailMethod · 0.80
countMethod · 0.65
beginMethod · 0.45
sizeMethod · 0.45
isValidMethod · 0.45
findMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected