@@ -24,7 +24,7 @@ BucketSnapshotManager::BucketSnapshotManager(
24
24
, mBloomLookups (
25
25
mMetrics .NewMeter({" bucketlistDB" , " bloom" , " lookups" }, " bloom" ))
26
26
{
27
- assertThreadIsMain ( );
27
+ releaseAssert ( threadIsMain () );
28
28
}
29
29
30
30
std::unique_ptr<SearchableBucketListSnapshot>
@@ -41,7 +41,7 @@ BucketSnapshotManager::recordBulkLoadMetrics(std::string const& label,
41
41
{
42
42
// For now, only keep metrics for the main thread. We can decide on what
43
43
// metrics make sense when more background services are added later.
44
- assertThreadIsMain ( );
44
+ releaseAssert ( threadIsMain () );
45
45
46
46
if (numEntries != 0 )
47
47
{
@@ -63,7 +63,7 @@ BucketSnapshotManager::getPointLoadTimer(LedgerEntryType t) const
63
63
{
64
64
// For now, only keep metrics for the main thread. We can decide on what
65
65
// metrics make sense when more background services are added later.
66
- assertThreadIsMain ( );
66
+ releaseAssert ( threadIsMain () );
67
67
68
68
auto iter = mPointTimers .find (t);
69
69
if (iter == mPointTimers .end ())
@@ -84,6 +84,9 @@ BucketSnapshotManager::maybeUpdateSnapshot(
84
84
if (!snapshot ||
85
85
snapshot->getLedgerSeq () != mCurrentSnapshot ->getLedgerSeq ())
86
86
{
87
+ // Should only update with a newer snapshot
88
+ releaseAssert (!snapshot || snapshot->getLedgerSeq () <
89
+ mCurrentSnapshot ->getLedgerSeq ());
87
90
snapshot = std::make_unique<BucketListSnapshot>(*mCurrentSnapshot );
88
91
}
89
92
}
@@ -93,7 +96,7 @@ BucketSnapshotManager::updateCurrentSnapshot(
93
96
std::unique_ptr<BucketListSnapshot const >&& newSnapshot)
94
97
{
95
98
releaseAssert (newSnapshot);
96
- assertThreadIsMain ( );
99
+ releaseAssert ( threadIsMain () );
97
100
std::lock_guard<std::recursive_mutex> lock (mSnapshotMutex );
98
101
releaseAssert (!mCurrentSnapshot || newSnapshot->getLedgerSeq () >=
99
102
mCurrentSnapshot ->getLedgerSeq ());
0 commit comments