You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@geode.apache.org by "Eric Shu (JIRA)" <ji...@apache.org> on 2017/03/16 22:12:41 UTC
[jira] [Resolved] (GEODE-2536) DiskId code confusing in how it
implements needsToBeWritten
[ https://issues.apache.org/jira/browse/GEODE-2536?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Eric Shu resolved GEODE-2536.
-----------------------------
Resolution: Fixed
> DiskId code confusing in how it implements needsToBeWritten
> -----------------------------------------------------------
>
> Key: GEODE-2536
> URL: https://issues.apache.org/jira/browse/GEODE-2536
> Project: Geode
> Issue Type: Improvement
> Components: persistence
> Reporter: Darrel Schneider
> Assignee: Eric Shu
>
> DiskId has an abstract method "needsToBeWritten." It is set to true by "markForWriting" and set to false by "unmarkForWriting." DiskId has two types of implementations: one for overflow only regions and one for persistent regions.
> The needsToBeWritten only makes sense for overflow only. But the persistent DiskIds also implement these methods and do so in a way that can be confused with "isKeyIdNegative."
> Since markForWriting will only be called for overflow only disk ids I recommend that the persistent implementation of this method be changed to always throw an exception.
> unmarkForWriting may be called on any type of disk id but for persistent ones should be changed to do nothing.
> needsToBeWritten should be changed to always return false for persistent DiskIds since they are immediately written to disk (or scheduled to be written if async) by whoever gives them a new value. needsToBeWritten is only called by the overflowToDisk method and for a persistent+overflow region it should never need to write the value to disk; all it needs to do is remove the value from memory since it is written to disk.
> The current implementation of these methods on persistent DiskIds do it by negating the keyId. Unfortunately this is also done to indicate that the value was not recovered from disk.
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)