|
50 | 50 | #include "fdbclient/S3BlobStore.h" |
51 | 51 | #include "fdbclient/SystemData.h" |
52 | 52 | #include "fdbclient/json_spirit/json_spirit_writer_template.h" |
| 53 | +#include "fdbclient/BackupContainer.h" |
53 | 54 |
|
54 | 55 | #include "flow/Platform.h" |
55 | 56 |
|
@@ -1612,6 +1613,32 @@ ACTOR Future<std::string> getLayerStatus(Reference<ReadYourWritesTransaction> tr |
1612 | 1613 | wait(waitForAll(tagLastRestorableVersions) && waitForAll(tagStates) && waitForAll(tagContainers) && |
1613 | 1614 | waitForAll(tagRangeBytes) && waitForAll(tagLogBytes) && success(fBackupPaused)); |
1614 | 1615 |
|
| 1616 | + state std::vector<Future<Void>> encryptionSetupResults; |
| 1617 | + state std::vector<int> encryptionContainerIndices; |
| 1618 | + |
| 1619 | + for (int i = 0; i < tagContainers.size(); i++) { |
| 1620 | + if (tagContainers[i].get()->getEncryptionKeyFileName().present()) { |
| 1621 | + encryptionSetupResults.push_back(tagContainers[i].get()->encryptionSetupComplete()); |
| 1622 | + encryptionContainerIndices.push_back(i); |
| 1623 | + } |
| 1624 | + } |
| 1625 | + wait(waitForAllReady(encryptionSetupResults)); |
| 1626 | + json_spirit::mArray keysArr; |
| 1627 | + std::unordered_set<std::string> seenKeyPaths; |
| 1628 | + for (int j = 0; j < encryptionContainerIndices.size() && j < 1e6; j++) { |
| 1629 | + int i = encryptionContainerIndices[j]; |
| 1630 | + std::string keyPath = tagContainers[i].get()->getEncryptionKeyFileName().get(); |
| 1631 | + |
| 1632 | + if (seenKeyPaths.find(keyPath) == seenKeyPaths.end()) { |
| 1633 | + seenKeyPaths.insert(keyPath); |
| 1634 | + json_spirit::mObject keyObj; |
| 1635 | + keyObj["path"] = tagContainers[i].get()->getEncryptionKeyFileName().get(); |
| 1636 | + keyObj["success"] = !encryptionSetupResults[j].isError(); |
| 1637 | + keysArr.push_back(keyObj); |
| 1638 | + } |
| 1639 | + } |
| 1640 | + o.create("encryption_keys") = keysArr; |
| 1641 | + |
1615 | 1642 | JSONDoc tagsRoot = layerRoot.subDoc("tags.$latest"); |
1616 | 1643 | layerRoot.create("tags.timestamp") = now(); |
1617 | 1644 | layerRoot.create("total_workers.$sum") = |
@@ -1640,7 +1667,11 @@ ACTOR Future<std::string> getLayerStatus(Reference<ReadYourWritesTransaction> tr |
1640 | 1667 | tagRoot.create("range_bytes_written") = tagRangeBytes[j].get(); |
1641 | 1668 | tagRoot.create("mutation_log_bytes_written") = tagLogBytes[j].get(); |
1642 | 1669 | tagRoot.create("mutation_stream_id") = backupTagUids[j].toString(); |
1643 | | - |
| 1670 | + tagRoot.create("file_level_encryption") = |
| 1671 | + tagContainers[j].get()->getEncryptionKeyFileName().present() ? true : false; |
| 1672 | + if (tagContainers[j].get()->getEncryptionKeyFileName().present()) { |
| 1673 | + tagRoot.create("encryption_key_file") = tagContainers[j].get()->getEncryptionKeyFileName().get(); |
| 1674 | + } |
1644 | 1675 | j++; |
1645 | 1676 | } |
1646 | 1677 | } else if (exe == ProgramExe::DR_AGENT) { |
|
0 commit comments