Skip to content

Commit

Permalink
[fix](auth) Fix ResourceTypeEnum Compatibility Upgrade (#39288)
Browse files Browse the repository at this point in the history
```
RuntimeLogger 2024-08-12 22:47:37,850 ERROR (replayer|88) [EditLog.loadJournal():1244] replay Operation Type 64, log id: 13752
java.lang.NullPointerException: Cannot invoke "org.apache.doris.analysis.ResourceTypeEnum.ordinal()" because the return value of "org.apache.doris.analysis.ResourcePattern.getResourceType()" is null
	at org.apache.doris.mysql.privilege.Role.<init>(Role.java:155) ~[doris-fe.jar:1.2-SNAPSHOT]
	at org.apache.doris.mysql.privilege.Auth.grantInternal(Auth.java:706) ~[doris-fe.jar:1.2-SNAPSHOT]
	at org.apache.doris.mysql.privilege.Auth.replayGrant(Auth.java:657) ~[doris-fe.jar:1.2-SNAPSHOT]
	at org.apache.doris.persist.EditLog.loadJournal(EditLog.java:466) ~[doris-fe.jar:1.2-SNAPSHOT]
	at org.apache.doris.catalog.Env.replayJournal(Env.java:2913) ~[doris-fe.jar:1.2-SNAPSHOT]
	at org.apache.doris.catalog.Env$4.runOneCycle(Env.java:2675) ~[doris-fe.jar:1.2-SNAPSHOT]
	at org.apache.doris.common.util.Daemon.run(Daemon.java:116) ~[doris-fe.jar:1.2-SNAPSHOT]
```

## Proposed changes

Issue Number: close #xxx

<!--Describe your changes.-->
  • Loading branch information
deardeng authored Aug 15, 2024
1 parent 90d92e9 commit e8fea85
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -134,5 +134,9 @@ public void gsonPostProcess() throws IOException {
if ("*".equals(resourceName)) {
resourceName = "%";
}
// 2.x -> 3.0 compatibility logic
if (resourceType == null) {
resourceType = ResourceTypeEnum.GENERAL;
}
}
}

0 comments on commit e8fea85

Please sign in to comment.