You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@accumulo.apache.org by "Keith Turner (JIRA)" <ji...@apache.org> on 2014/02/26 17:01:20 UTC

[jira] [Commented] (ACCUMULO-2409) InMemoryMap.compactionIterator() not safe against calls during mutation processing

    [ https://issues.apache.org/jira/browse/ACCUMULO-2409?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13913062#comment-13913062 ] 

Keith Turner commented on ACCUMULO-2409:
----------------------------------------

Looking at this sanity checking, a much stronger assertion could be made.  Currently it attempts to assert there is no write in progress when trying to get a compaction iterator.  Writes while obtaining or after obtaining a compaction iterator are unexpected and indicate an error.   Checks could also be added to fail any writes attempted after obtaining a compaction iterator.

The code that prevents writes during a minor compaction is a combination of {{Tablet.TabletMemory.prepareForMinC()}} and {{Tablet.CommitSession.waitForCommitsToFinish()}}.  If this is not working propery then it would be really nice to know.  



> InMemoryMap.compactionIterator() not safe against calls during mutation processing
> ----------------------------------------------------------------------------------
>
>                 Key: ACCUMULO-2409
>                 URL: https://issues.apache.org/jira/browse/ACCUMULO-2409
>             Project: Accumulo
>          Issue Type: Bug
>          Components: tserver
>    Affects Versions: 1.4.4, 1.5.0
>            Reporter: Bill Havanki
>            Priority: Minor
>
> A sanity check in {{InMemoryMap.compactionIterator()}} ensures that the key/value counts (mutation counts) tracked by the map are consistent, i.e., that the "next" count is one more than the current count. If they are not consistent, an {{IllegalStateException}} is thrown.
> A synchronization object is used to serialize the processing of lists of mutations, and while a thread has that object locked, it adjusts the counts. However, the {{compactionIterator()}} method does not use that synchronization and so it can see the counts in an inconsistent state.
> It is possible that in practice there is no case where {{compactionIterator()}} is called while mutations are being processed. However, the sanity check could be performed while locking the sync object, making the call safer. Probably even better would be to also get the iterator during that time, when it's guaranteed no mutations are in flight. That may be the point of the check.



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)