backport glib version fix, lsn_reset fix

This commit is contained in:
Brannon King 2021-04-15 21:15:16 -04:00
parent cd7c2961dc
commit 60a3d11df2
4 changed files with 3736 additions and 7 deletions

File diff suppressed because it is too large Load diff

View file

@ -1,11 +1,11 @@
linux_CFLAGS=-pipe linux_CFLAGS=-pipe
linux_CXXFLAGS=$(linux_CFLAGS) linux_CXXFLAGS=$(linux_CFLAGS)
linux_release_CFLAGS=-O2 linux_release_CFLAGS=-O3 -g -include $(BASEDIR)/glibc_version_header/force_link_glibc_2.19.h
linux_release_CXXFLAGS=$(linux_release_CFLAGS) linux_release_CXXFLAGS=$(linux_release_CFLAGS)
linux_debug_CFLAGS=-Og linux_debug_CFLAGS=-O1 -g
linux_debug_CXXFLAGS=$(linux_debug_CFLAGS) linux_debug_CXXFLAGS=-O0 -g
linux_debug_CPPFLAGS=-D_GLIBCXX_DEBUG -D_GLIBCXX_DEBUG_PEDANTIC linux_debug_CPPFLAGS=-D_GLIBCXX_DEBUG -D_GLIBCXX_DEBUG_PEDANTIC

View file

@ -469,10 +469,10 @@ bool BerkeleyEnvironment::Salvage(const std::string& strFile, bool fAggressive,
} }
void BerkeleyEnvironment::CheckpointLSN(const std::string& strFile) void BerkeleyEnvironment::CheckpointLSN(const std::string& strFile, bool lsnReset)
{ {
dbenv->txn_checkpoint(0, 0, 0); dbenv->txn_checkpoint(0, 0, 0);
if (fMockDb) if (fMockDb || !lsnReset)
return; return;
dbenv->lsn_reset(strFile.c_str(), 0); dbenv->lsn_reset(strFile.c_str(), 0);
} }
@ -799,7 +799,7 @@ bool BerkeleyBatch::PeriodicFlush(BerkeleyDatabase& database)
// Flush wallet file so it's self contained // Flush wallet file so it's self contained
env->CloseDb(strFile); env->CloseDb(strFile);
env->CheckpointLSN(strFile); env->CheckpointLSN(strFile, false); // too expensive to reset LSN periodically (and it's triggered on flush or backup
env->mapFileUseCount.erase(mi++); env->mapFileUseCount.erase(mi++);
LogPrint(BCLog::DB, "Flushed %s %dms\n", strFile, GetTimeMillis() - nStart); LogPrint(BCLog::DB, "Flushed %s %dms\n", strFile, GetTimeMillis() - nStart);

View file

@ -83,7 +83,7 @@ public:
bool Open(bool retry); bool Open(bool retry);
void Close(); void Close();
void Flush(bool fShutdown); void Flush(bool fShutdown);
void CheckpointLSN(const std::string& strFile); void CheckpointLSN(const std::string& strFile, bool lsnReset = true);
void CloseDb(const std::string& strFile); void CloseDb(const std::string& strFile);
void ReloadDbEnv(); void ReloadDbEnv();