[
https://issues.apache.org/jira/browse/RATIS-1654?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18146202#comment-18146202
]
Elia Renzoni commented on RATIS-1654:
-------------------------------------
[~szetszwo] Is this JIRA still relevant? I’ve taken a quick look at the
codebase, and the issue seems to still be present. If so I think the proposed
solution would work well, adding a dedicated state would make things clearer
for users.
> Add a StorageState to represent insufficient privilege
> ------------------------------------------------------
>
> Key: RATIS-1654
> URL: https://issues.apache.org/jira/browse/RATIS-1654
> Project: Ratis
> Issue Type: Improvement
> Reporter: Wei-Chiu Chuang
> Assignee: Elia Renzoni
> Priority: Minor
>
> If raft is unable to initialize a storage due to insufficient privlege (e.g.
> the directory is owned by root and raft is run by ozone user) it throws a
> confusing error:
> {noformat}
> 2022-08-01 10:28:17,936 WARN org.apache.ratis.server.RaftServer$Division:
> Failed to init RaftStorage under /var/lib/hadoop-ozone/datanode/ratis/data
> for xxxxxxxx-ab0c-49de-841a-57b299820e4e: {}
> java.io.IOException: Cannot load Storage Directory
> /var/lib/hadoop-ozone/datanode/ratis/data/xxxxxxxx-ab0c-49de-841a-57b299820e4e.
> Its state: NON_EXISTENT
> at
> org.apache.ratis.server.storage.RaftStorageImpl.<init>(RaftStorageImpl.java:70)
> at
> org.apache.ratis.server.storage.RaftStorageImpl.<init>(RaftStorageImpl.java:52)
> at
> org.apache.ratis.server.impl.ServerState.<init>(ServerState.java:116)
> at
> org.apache.ratis.server.impl.RaftServerImpl.<init>(RaftServerImpl.java:201)
> at
> org.apache.ratis.server.impl.RaftServerProxy.lambda$newRaftServerImpl$5(RaftServerProxy.java:274)
> at
> java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1700)
> at
> java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
> at
> java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
> at java.base/java.lang.Thread.run(Thread.java:834)
> {noformat}
> Instead of NON_EXISTENT it would be less ambiguous to add a
> INSUFFICIENT_PRIVILEGE state.
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)