[
https://issues.apache.org/jira/browse/HDFS-13578?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16493811#comment-16493811
]
Erik Krogen commented on HDFS-13578:
------------------------------------
{quote}
One thing I'm thinking is whether we should have tests for these methods on
Observer NN (once we completed other tasks). Perhaps it's worth a separate JIRA
{quote}
+1
{quote}
For {{getDatanodeReport()}} and {{getDatanodeStorageReport()}}, seems they are
already unchecked so no need to do that. For {{getQuotaUsage()}}, the SBN
doesn't keep up-to-date quota info due to HDFS-6763, so I didn't mark it.
{quote}
For the datanode methods, does it matter that it is marked as UNCHECKED? I
thought that this annotation would be used on the client-side to determine
which requests to send to the observer. The client wouldn't know that the
server-side implementation uses UNCHECKED.
About quota usage, this is a great point, but now this is making me rethink the
annotation. While the annotation _says_ it marks methods that are read-only,
_really_ what it is marking is methods that can be read from the
standby/observer (notice that our previous comments have discussed whether it
is safe to read from standby, not if it is a read-only operation). I think we
should do something to reconcile this mismatch, for example:
* Rename the annotation to {{@Observable}}, {{@ReadFromStandby}}, something
along these lines to more closely reflect how we are using it.
* Keep the current name, and annotate _all_ methods which are read-only, but
have an additional flag like {{activeOnly}} (defaults to false) indicating
that, although this method is read-only, it should still only be performed on
the active.
I would lean towards the latter because I think the {{@ReadOnly}} annotation is
the most intuitive... Any thoughts?
> Add ReadOnly annotation to methods in ClientProtocol
> ----------------------------------------------------
>
> Key: HDFS-13578
> URL: https://issues.apache.org/jira/browse/HDFS-13578
> Project: Hadoop HDFS
> Issue Type: Sub-task
> Reporter: Chao Sun
> Assignee: Chao Sun
> Priority: Major
> Attachments: HDFS-13578-HDFS-12943.000.patch,
> HDFS-13578-HDFS-12943.001.patch, HDFS-13578-HDFS-12943.002.patch,
> HDFS-13578-HDFS-12943.004.patch
>
>
> For those read-only methods in {{ClientProtocol}}, we may want to use a
> {{@ReadOnly}} annotation to mark them, and then check in the proxy provider
> for observer.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]