geode-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF subversion and git services (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (GEODE-2536) DiskId code confusing in how it implements needsToBeWritten
Date Thu, 16 Mar 2017 22:11:41 GMT

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

ASF subversion and git services commented on GEODE-2536:
--------------------------------------------------------

Commit 0c85fd656ad1314397a871dc707cd0382632f9b7 in geode's branch refs/heads/develop from
[~eshu]
[ https://git-wip-us.apache.org/repos/asf?p=geode.git;h=0c85fd6 ]

GEODE-2536: Remove the inappropriate implementation of methods in DiskId for persistent regions.

markForWriting and unmarkForWriting should not be used for persistent region.
needsToBeWritten always return false now for persistent region, as the diskEntry either is
being written to disk (sync) or sheduled to be written to disk (async)


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

Mime
View raw message