LuciferYang opened a new pull request, #2843: URL: https://github.com/apache/uniffle/pull/2843
### What changes were proposed in this pull request? The shuffle server now checks two values of a request before it uses them in a storage path. - appId: it has to be a single plain path segment. That means not blank, at most 255 bytes in UTF-8, no `/`, `\` or control characters, and no leading `.`. The gRPC and Netty services reject a malformed appId with `INVALID_REQUEST`, and `ShuffleStorageUtils` checks it again when it builds a path. With remote merge enabled, `registerShuffle` also rejects an appId that gets too long with the `@RemoteMerge` suffix. - Remote storage of `registerShuffle`: the path has to be fully qualified, free of `.` and `..` segments, and under one of the paths in the new `rss.server.remote.storage.allowed.paths`. The file system classes come from the server's hadoop conf, so `fs.*.impl` keys in the request conf are ignored. A scheme the server can't load is rejected when the storage is registered, not at the first flush. ### Why are the changes needed? The client chooses both values, and the server joins them into the paths it writes to and deletes from. Checking them on the server keeps every application inside the storage locations the server is configured with. Fix: #2842 ### Does this PR introduce _any_ user-facing change? Yes. - New config `rss.server.remote.storage.allowed.paths`. A deployment that uses remote storage must set it on every shuffle server, usually to the same value as `rss.coordinator.remote.storage.path`. If it's unset, the server logs a WARN at startup and rejects every register request that carries a remote storage. - A request with a malformed appId gets `INVALID_REQUEST`. `requireBuffer` still accepts the empty appId sent by old clients. - A client can no longer set `fs.<scheme>.impl`. Set it in the server's hadoop conf. ### How was this patch tested? New unit tests: - `RssUtilsTest`: the appId rules, including the byte limit with multi-byte chars and surrogates. - `ShuffleServerGrpcServiceTest`, `ShuffleServerNettyHandlerTest`: every endpoint rejects a malformed appId without registering it. A rejected request leaves no app or remote storage behind, and Netty releases its pre-allocated buffer. - `HadoopStorageManagerTest`: allowed and rejected paths, invalid allowed-path entries, ignored `fs.*.impl` keys (padded keys included), and schemes that can't be loaded. - `LocalStorageManagerTest`, `ShuffleStorageUtilsTest`, `LocalFileHandlerTest`, `ServerRpcAuditContextTest`: the path helpers and the audit log. The existing tests that register a remote storage now set the allowed paths of their test clusters. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
