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

ASF GitHub Bot commented on GEODE-3764:
---------------------------------------

dschneider-pivotal commented on a change in pull request #940: GEODE-3764: 
prevent early idle expiration
URL: https://github.com/apache/geode/pull/940#discussion_r146357891
 
 

 ##########
 File path: 
geode-core/src/main/java/org/apache/geode/internal/cache/ExpiryTask.java
 ##########
 @@ -149,13 +155,34 @@ long getExpiryMillis() throws EntryNotFoundException {
    */
   protected boolean isExpirationPossible() throws EntryNotFoundException {
     long expTime = getExpirationTime();
-    if (expTime > 0L && getNow() >= expTime) {
-      return true;
+    if (expTime > 0L) {
 
 Review comment:
   Then it is okay to just expire based on the local information.
   Since last modified time is always changed by a write and since writes go to 
every copy of the data the ttl check only needs to happen locally.
   The way this works in this fix is that the implementation of 
isIdleExpiredOnOthers
   does this check:
       if (getIdleAttributes().getTimeout() <= 0L) {
         // idle expiration is not being used
         return true;
       }
   So if you expiration configuration does not care about idle time then we 
just return true which means expiration is possible.
   If we are using idle time then we fetch it from others and redo this 
calculation which may cause is to still expire due to ttl (note that you can 
have both idle and ttl configured on a region).

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


> idle expiration will happen even if the entry has been accessed on a replicate
> ------------------------------------------------------------------------------
>
>                 Key: GEODE-3764
>                 URL: https://issues.apache.org/jira/browse/GEODE-3764
>             Project: Geode
>          Issue Type: Bug
>          Components: docs, expiration
>            Reporter: Darrel Schneider
>            Assignee: Darrel Schneider
>
> Because idle expiration is currently always based on if the entry has been 
> accessed on the local node it is possible that entries will idle expire even 
> if they were accessed recently.
> Since reads are only sent to one member, the last access time is only updated 
> on that member. The expiration action itself is distributed so if any member 
> was not read from recently, it will cause the entry to be expired on the 
> entire cluster.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to