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

Hanisha Koneru edited comment on RATIS-923 at 5/8/20, 10:56 PM:
----------------------------------------------------------------

In CacheInvalidationPolicy, we check that the segment endIndex is less than 
equal to the local flushed Index. One option is to  change this check to 
instead compare the segment endIndex with the largest index in a closed 
segment. This way a segment would not be evicted from cache unless it has been 
finalized on disk too. 

[~msingh] does this approach sound reasonable? I still have some open questions 
with this approach but wanted to get your opinion on it. Open questions:

1. Should the "largest index in closed segment" be updated during startup. If 
logs have been purged, how will cache eviction be affected.

2. How will cache eviction be affected by snapshotIndex.


was (Author: hanishakoneru):
In CacheInvalidationPolicy, we check that the segment endIndex is less than 
equal to the local flushed Index. One option is to  change this check to 
instead compare the segment endIndex with the largest index in a closed 
segment. This way a segment would not be evicted from cache unless it has been 
finalized on disk too. 

[~msingh] does this approach sound reasonable? I still have some open questions 
with this approach but wanted to get your opinion on it. Open questions:

1. Should the "largest index in closed segment" be updates during startup. If 
logs have been purged, how will cache eviction be affected.

2. How will cache eviction be affected by snapshotIndex.

> Cache evicted before RollSegment completes
> ------------------------------------------
>
>                 Key: RATIS-923
>                 URL: https://issues.apache.org/jira/browse/RATIS-923
>             Project: Ratis
>          Issue Type: Bug
>            Reporter: Hanisha Koneru
>            Assignee: Hanisha Koneru
>            Priority: Major
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> If a segment is evicted from Segment Cache before it is rolled over and 
> applyTransaction thread tries to read this segment, it can lead to 
> FileNotFoundException.
> Please refer to [~msingh]'s comment in HDDS-3382.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to