Github user JamesRTaylor commented on a diff in the pull request:
https://github.com/apache/phoenix/pull/118#discussion_r41041264
--- Diff:
phoenix-core/src/main/java/org/apache/phoenix/schema/PMetaDataImpl.java ---
@@ -160,7 +160,7 @@ public PMetaDataCache cloneMinusOverage(long overage) {
newCache.put(tableRef.table.getKey(), new
PTableRef(tableRef));
toRemove.add(tableRef);
toRemoveBytes += tableRef.estSize;
- if (toRemoveBytes - toRemove.peekLast().estSize >
overage) {
+ while (toRemoveBytes - toRemove.peekLast().estSize >=
overage) {
--- End diff --
Probably worth a test or two in PMetaDataImplTest. I haven't worked with
this code in a while, but I seem to remember that we keep at least one item in
PMetaDataImpl, even if it's larger than the configured max size (which would
imply that we should break out of the loop when the size is one). Also, what if
the max size is configured to be zero?
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---