GitHub user chiastic-security opened a pull request:

    https://github.com/apache/phoenix/pull/118

    Correct two bugs in PMetaDataImpl

    More entries than necessary could end up being evicted.
    
    This PR also adds a new test to catch one of the bugs.
    
    Previously, one of the bugs (`>` should have been `>=`) was being picked up 
on Java 8, but not Java 7, because the traversal ordering of one of the JDK 
collections happened to have changed. The bug was still present in Java 7, but 
the collection ordering meant that the test didn't pick it up.
    
    The second bug (`if` should have been `while`) is picked up by the new test 
on both Java 7 and Java 8. The essence of the bug is that if several things are 
queued for eviction, and something large and old gets added to the eviction 
queue, the implementation was only considering removing one element from the 
eviction queue, whereas it should have removed as many as possible from the 
eviction queue while still leaving enough to clear space for the new element 
being added to the table.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/chiastic-security/phoenix-for-cloudera master

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/phoenix/pull/118.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #118
    
----
commit def72e50806cd2c4ea50807a25667714099a4a5d
Author: James Heather <[email protected]>
Date:   2015-10-02T14:14:24Z

    Correct two bugs in PMetaDataImpl, whereby more entries than necessary 
could end up being evicted; also add a new test to catch one of the bugs.
    
    Previously, one of the bugs (">" should have been ">=") was only being 
picked up on Java 8, because the traversal ordering of one of the JDK 
collections happened to have changed. The bug was still present in Java 7, but 
the collection ordering meant that the test didn't pick it up.
    
    The second bug ("if" should have been "while") is picked up by the new test 
on both Java 7 and Java 8. The essence of the bug is that if several things are 
queued for eviction, and something large and old gets added to the eviction 
queue, the implementation was only considering removing one element from the 
eviction queue, whereas it should have removed as many as possible from the 
eviction queue while still leaving enough to clear space for the new element 
being added to the table.

----


---
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.
---

Reply via email to