-
Notifications
You must be signed in to change notification settings - Fork 304
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HPCC-30564 Prevent pending write externals being flushed from cache. #17953
HPCC-30564 Prevent pending write externals being flushed from cache. #17953
Conversation
75938dd
to
3a3d94d
Compare
@@ -1956,6 +1967,8 @@ class CExtCache | |||
if (mapIt != extTable.end()) | |||
{ | |||
auto listIter = mapIt->second; | |||
Linked<CTransactionItem> &existingItem = *listIter; | |||
cachedSz -= existingItem->ext.dataLength; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ghalliday - I spotted this in some late testing. Basically it would mean that although the cache was low, the cachedSz was left high, resulting in repeated spurious premature attempts to purge the ext. cache. It would mean that the external cache was effectively a 1-element cache after running for some time.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One comment - will re-review tomorrow.
dali/base/dasds.cpp
Outdated
// pending on write. | ||
unsigned extCacheSizeMB = config.getPropInt("@extCacheSizeMB", defaultExtCacheSizeMB); | ||
unsigned deltaTransactionMaxMemMB = config.getPropInt("@deltaTransactionMaxMemMB", defaultDeltaMemMaxMB); | ||
if (extCacheSizeMB && deltaTransactionMaxMemMB && (extCacheSizeMB < deltaTransactionMaxMemMB)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be <= rather than <?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, it should, I'll change and squash that minor change in.
Flushing some externals from the external cache (when full), whilst the transactions are still pending to be written could cause subsequent ext. cache lookups to attempt to look to disk for the external, and fail with "Missing external file ". Also fix a bug with cachedSz. Transactions that removed externals, were being removed from the cache, but their size was not deducted from cachedSz. Consequently, over time, the extCache would falsely appear full, meaning it was purged prematurely. Signed-off-by: Jake Smith <[email protected]>
3a3d94d
to
588dccf
Compare
Flushing some externals from the external cache (when full), whilst the transactions are still pending to written could cause subsequent ext. cache lookups to attempt to look to disk for the external, and fail with "Missing external file ".
Type of change:
Checklist:
Smoketest:
Testing: