You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 99016ab
Browse filesBrowse the repository at this point in the historyBrowse files
[fix](ranger) Refuse an unusable configuration before the load starts, and replace a plugin whose load failed
Review finding F-01 on 400194c. Since the plugin loads on its own thread,
an exception out of RangerBasePlugin.init() no longer reached whoever built the
plugin: a CREATE CATALOG whose fe/conf lacks ranger-<type>-security.xml (an
empty policy.rest.url), a REST timeout that is not a number, or an audit
destination Doris does not ship succeeded where the dry run used to fail it
with the cause, every check on the catalog was then refused with a generic
"no answer" message, and - for ranger-doris - the failed plugin was kept as the
shared one and handed to every later binding, so fixing the configuration
took a restart of every FE.
init() now does the part of the load that needs no admin on the calling
thread, before it starts the load (preflight): the audit subsystem, when this
plugin is the first to need it, and the admin client - RangerAdminRESTClient
fails on exactly the configuration errors above and dials nothing until its
first use, and PolicyRefresher and the user store retriever reuse the client
found in the plugin context. So those errors fail the constructor again, which
is what the dry run and an FE start see; a refused init() leaves the plugin
as it was.
What only the load can find - a chained plugin that fails to start, a
refresher setting only the refresher reads - still fails the load, but the
failed plugin is no longer kept: isFailed() is public, and both factories let
go of a failed plugin on the way in, evict the controllers over it (a re-attach
must not be handed it again; the bindings still holding them refuse as before
and stop nothing when they let go), stop what is left of it, and build a new
one for the binding being made. A catalog recovers on ALTER CATALOG once the
cause is fixed; the instance-scope source, bound once at start, on a restart -
which is what the ERROR line now says, instead of promising a restart for
ranger-hive too.
The two engine comments that described the dry run as proving the source
usable now say what it proves: what the constructor checks.
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_0191LreyBauJV7K7sZAbrB27
Copy file name to clipboardExpand all lines: fe/fe-authorization/fe-authorization-plugins/fe-authorization-plugin-ranger-common/src/main/java/org/apache/doris/catalog/authorizer/ranger/BackgroundLoadedRangerPlugin.java
Copy file name to clipboardExpand all lines: fe/fe-authorization/fe-authorization-plugins/fe-authorization-plugin-ranger-doris/src/main/java/org/apache/doris/catalog/authorizer/ranger/doris/RangerDorisAccessController.java
+3-1Lines changed: 3 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -131,7 +131,9 @@ public void close() {
131
131
return;
132
132
}
133
133
// Built directly rather than through the factory - a test, or an embedding that owns its own plugin -
134
-
// so there is nobody else to account for and the plugin is ours to stop.
134
+
// so there is nobody else to account for and the plugin is ours to stop. Or the factory has let go of
135
+
// this controller with the failed plugin it is over, which has stopped itself and takes this as a
Copy file name to clipboardExpand all lines: fe/fe-authorization/fe-authorization-plugins/fe-authorization-plugin-ranger-doris/src/main/java/org/apache/doris/catalog/authorizer/ranger/doris/RangerDorisAccessControllerFactory.java
+46-2Lines changed: 46 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -62,6 +62,9 @@ public class RangerDorisAccessControllerFactory implements AuthorizationPluginFa
62
62
* policy refresher and joins it without a timeout - and then the whole first load on the way back up:
63
63
* roles, policies and user store downloaded again, on the plugin's own thread, before the catalog answers
64
64
* a single check.
65
+
*
66
+
* <p>The one exception is a plugin whose first load threw: it has stopped itself and refuses every
67
+
* check, and the next binding lets go of it and builds a new one, see {@link #letGoOfAFailedPlugin()}.
0 commit comments