You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ratis.apache.org by "Wei-Chiu Chuang (Jira)" <ji...@apache.org> on 2022/08/01 17:56:00 UTC

[jira] [Created] (RATIS-1654) Add a StorageState to represent insufficient privilege

Wei-Chiu Chuang created RATIS-1654:
--------------------------------------

             Summary: 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


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
(v8.20.10#820010)