[
https://issues.apache.org/jira/browse/HBASE-21070?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16754531#comment-16754531
]
Mingliang Liu commented on HBASE-21070:
---------------------------------------
# The UT is simple but makes sure we don't rely on the last modified time. It
makes sense to me.
# I think the {{synchronized}} keyword for {{refreshCache}} method will be
enough to establish happens-before relationship to other threads calling the
same method. Refer to
[this|https://docs.oracle.com/javase/tutorial/essential/concurrency/syncmeth.html]
page. So the content and the reference of {{cache}} and {{snapshots}} will be
cool across threads. No volatile is needed if we interpret the semantics the
same. By the way, the tests pass consistently (>10 times) at my dev machine
without "volatile" for {{cache}} or {{snapshots}}.
{code}
LOG.debug("No snapshots on-disk under: {}, cache empty", snapshotDir);
{code}
Nit: I appreciate the good intention of using {{LOG.isDebugEnabled()}} to
further guard the unnecessary cost of generating logs, but I think it's not
required if we use placeholder. But it harms nothing of course.
Thanks!
> SnapshotFileCache won't update for snapshots stored in S3
> ---------------------------------------------------------
>
> Key: HBASE-21070
> URL: https://issues.apache.org/jira/browse/HBASE-21070
> Project: HBase
> Issue Type: Bug
> Components: snapshots
> Affects Versions: 3.0.0, 2.1.1, 1.4.7
> Reporter: Zach York
> Assignee: Zach York
> Priority: Critical
> Labels: FSRedo, s3
> Fix For: 3.0.0, 1.5.0, 2.2.0
>
> Attachments: HBASE-21070.master.001.patch,
> HBASE-21070.master.002.patch, HBASE-21070.master.003.patch
>
>
> The SnapshotFileCache depends on last modified time to determine whether to
> update the Snapshot HFile cache. However, in S3, real 'folders' don't exist.
> S3 filesystems create a dummy file in place of a folder, but the dummy file
> last modified time is not updated when files are changed 'under' it. This
> means that the SnapshotFileCache doesn't pick up new snapshot HFiles and
> these files aren't removed from the HFileCleaner and can be eligible for
> deletion.
>
> My patch removes the lastmodified assumption.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)