accumulo-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Keith Turner (JIRA)" <>
Subject [jira] [Commented] (ACCUMULO-2409) InMemoryMap.compactionIterator() not safe against calls during mutation processing
Date Wed, 26 Feb 2014 16:01:20 GMT


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

View raw message