KAFKA-12190: Fix setting of file permissions on non-POSIX filesystems#9947
KAFKA-12190: Fix setting of file permissions on non-POSIX filesystems#9947ableegoldman merged 3 commits intoapache:trunkfrom
Conversation
373333e to
7c7f321
Compare
7c7f321 to
1fa058e
Compare
ableegoldman
left a comment
There was a problem hiding this comment.
Thanks for the fix! I had a few questions about how to set the permissions for non-users, but I may be out of my depth when it comes to non-posix permissions so let me know if I'm just not on the same page here.
showuon
left a comment
There was a problem hiding this comment.
Thanks for the fix. Overall looks good. Left some comments. Thanks.
|
Thanks for the reviews. I've addressed the comments other than possibly passing the |
|
I think all the review comments have now been addressed. Please let me know if you'd like the commits to be squashed into one. |
|
Don't worry about squashing all the commits yourself, we'll do that automatically when merging it. Three test failures in the build, all unrelated: |
ableegoldman
left a comment
There was a problem hiding this comment.
LGTM, thanks for the patch
…#9947) Previously, StateDirectory used PosixFilePermissions to configure its directories' permissions which fails on Windows as its file system is not POSIX-compliant. This PR updates StateDirectory to fall back to the File API on non-POSIX-compliant file systems. Reviewers: Luke Chen <43372967+showuon@users.noreply.github.com>, Anna Sophie Blee-Goldman <ableegoldman@apache.org>
|
Merged to trunk and cherrypicked to 2.7 |
|
I tried to cherrypick this back to the 2.6 branch but there was a merge conflict. I would be happy to review & merge another PR if you'd like to open one against the 2.6 branch, but realistically I think it's unlikely that we'll have a 2.6.2 release just given the lack of x.x.2 releases in recent history. We can also just keep an eye out for a proposed 2.6.2 release and then work on another patch for the 2.6 branch if that does happen |
|
Thanks for the merge. Given that the regression in 2.6.1 makes Streams unusable for developers working on Windows, I really think that a 2.6.2 release is needed here. To that end, I've opened a new pull request based on the 2.6 branch. |
|
As I commented on the JIRA issue I think it is important to get a 2.6.2 release out sooner rather than later. |
|
@garyrussell I just merged the 2.6 PR so we'll be ready to go if/when the 2.6.2 release is started. To be honest I'm not sure how likely it is for a 2.6.2 release to be rushed out. It's a lot of work to roll out an AK release, even a bugfix. It might be difficult to convince someone to take all that on as a release manager in order to fix a regression that impacts a relatively small subset of users (this is not my personal philosophy, just my expectation). That said, it's always worth asking, and the dev mailing list is probably the best way to get some attention. |
…e-allocations-lz4 * apache-github/trunk: (562 commits) MINOR: remove unused code from MessageTest (apache#9961) MINOR: Fix visibility of Log.{unflushedMessages, addSegment} methods (apache#9966) KAFKA-12229: Restore original class loader in integration tests using EmbeddedConnectCluster during shutdown (apache#9942) KAFKA-12190: Fix setting of file permissions on non-POSIX filesystems (apache#9947) MINOR: Remove `toStruct` and `fromStruct` methods from generated protocol classes (apache#9960) MINOR: Fix typo in Utils#toPositive (apache#9943) MINOR: MessageUtil: remove some deadcode (apache#9931) MINOR: Update zstd-jni to 1.4.8-2 (apache#9957) MINOR: Revert assertion in MockProducerTest (apache#9956) MINOR: Optimize assertions in unit tests (apache#9955) MINOR: Tag `RaftEventSimulationTest` as `integration` and tweak it (apache#9925) MINOR: Update to Gradle 6.8.1 (apache#9953) MINOR: A few small group coordinator cleanups (apache#9952) MINOR: Upgrade ducktape to version 0.8.1 (apache#9933) MINOR: fix record time in test shouldWipeOutStandbyStateDirectoryIfCheckpointIsMissing (apache#9948) MINOR: Restore interrupt status when closing (apache#9863) KAFKA-10357: Extract setup of repartition topics from Streams partition assignor (apache#9848) KAFKA-12212; Bump Metadata API version to remove `ClusterAuthorizedOperations` fields (KIP-700) (apache#9945) MINOR: log 2min processing summary of StreamThread loop (apache#9941) MINOR: Drop enable.metadata.quorum config (apache#9934) ...
|
@ableegoldman I understand, but for the reasons I stated on the JIRA, this was a critical regression and some users have no choice regarding upgrading. I have no personal ax to grind; I don't use Windows, but many developers have no choice there either. I wonder if there could be a new mechanism to just release the kafka-clients, e.g. 2.6.1.1 ? |
|
Yeah that's completely valid, but unfortunately it's not up to me 🙂 I do think you should raise this on the mailing list -- maybe someone there will have an idea of how to proceed. I also think it's worth bringing up to get some discussion going on how we can avoid things like this from happening again, since testing on Windows is (obviously) not part of the current release process. |
|
@wilkinsona Hello thank you for the fix, I still have an issue, using KeyValueStore and getting Tried to debug and this always returns false ( set &= file.setWritable(true, true) ) |
|
@notme159 |
|
@aybefox Well the folder permissions are correct (it is writable), it just logs error when the setWritable is called. So I just suppress the StateDirectory log in log4j config using FATAL level only for this class, not to show ERROR in log. |
Previously,
StateDirectoryusedPosixFilePermissionsto configure its directories' permissions which fails on Windows as its file system is not POSIX-compliant. This PR updatesStateDirectoryto fall back to theFileAPI on non-POSIX-compliant file systems. The File API doesn't allow as much control over the permissions so they're as close as the API permits.The unit tests have been updated to also verify the behaviour on non-POSIX-compliant file systems.
Committer Checklist (excluded from commit message)