Merge #10985: Add undocumented -forcecompactdb to force LevelDB compactions
8842d1a
Add undocumented -forcecompactdb to force LevelDB compactions (Pieter Wuille)
Pull request description:
Tree-SHA512: de91f3f574f75248fa6e5091089c840957fae5a972ebcd2b89493f7d777d4658560a6f5a3b43ab0c9b2c333ad98f9f185ae224c9caffc1a5e8df369cc414f123
This commit is contained in:
commit
d896d5cc42
2 changed files with 7 additions and 1 deletions
|
@ -21,7 +21,7 @@ CMD_GREP_DOCS = r"egrep -r -I 'HelpMessageOpt\(\"\-[^\"=]+?(=|\")' %s" % (CMD_RO
|
||||||
REGEX_ARG = re.compile(r'(?:map(?:Multi)?Args(?:\.count\(|\[)|Get(?:Bool)?Arg\()\"(\-[^\"]+?)\"')
|
REGEX_ARG = re.compile(r'(?:map(?:Multi)?Args(?:\.count\(|\[)|Get(?:Bool)?Arg\()\"(\-[^\"]+?)\"')
|
||||||
REGEX_DOC = re.compile(r'HelpMessageOpt\(\"(\-[^\"=]+?)(?:=|\")')
|
REGEX_DOC = re.compile(r'HelpMessageOpt\(\"(\-[^\"=]+?)(?:=|\")')
|
||||||
# list unsupported, deprecated and duplicate args as they need no documentation
|
# list unsupported, deprecated and duplicate args as they need no documentation
|
||||||
SET_DOC_OPTIONAL = set(['-rpcssl', '-benchmark', '-h', '-help', '-socks', '-tor', '-debugnet', '-whitelistalwaysrelay', '-prematurewitness', '-walletprematurewitness', '-promiscuousmempoolflags', '-blockminsize', '-dbcrashratio'])
|
SET_DOC_OPTIONAL = set(['-rpcssl', '-benchmark', '-h', '-help', '-socks', '-tor', '-debugnet', '-whitelistalwaysrelay', '-prematurewitness', '-walletprematurewitness', '-promiscuousmempoolflags', '-blockminsize', '-dbcrashratio', '-forcecompactdb'])
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
used = check_output(CMD_GREP_ARGS, shell=True)
|
used = check_output(CMD_GREP_ARGS, shell=True)
|
||||||
|
|
|
@ -115,6 +115,12 @@ CDBWrapper::CDBWrapper(const fs::path& path, size_t nCacheSize, bool fMemory, bo
|
||||||
dbwrapper_private::HandleError(status);
|
dbwrapper_private::HandleError(status);
|
||||||
LogPrintf("Opened LevelDB successfully\n");
|
LogPrintf("Opened LevelDB successfully\n");
|
||||||
|
|
||||||
|
if (GetBoolArg("-forcecompactdb", false)) {
|
||||||
|
LogPrintf("Starting database compaction of %s\n", path.string());
|
||||||
|
pdb->CompactRange(nullptr, nullptr);
|
||||||
|
LogPrintf("Finished database compaction of %s\n", path.string());
|
||||||
|
}
|
||||||
|
|
||||||
// The base-case obfuscation key, which is a noop.
|
// The base-case obfuscation key, which is a noop.
|
||||||
obfuscate_key = std::vector<unsigned char>(OBFUSCATE_KEY_NUM_BYTES, '\000');
|
obfuscate_key = std::vector<unsigned char>(OBFUSCATE_KEY_NUM_BYTES, '\000');
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue