Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "Disallow duplicate storage paths (#26484)" #29171

Closed
wants to merge 3 commits into from

Conversation

wxiaoguang
Copy link
Contributor

Revert #26484

Discussion: #26484 (comment) and #26484 (comment)

@wxiaoguang wxiaoguang added this to the 1.22.0 milestone Feb 14, 2024
@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Feb 14, 2024
@pull-request-size pull-request-size bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Feb 14, 2024
@wxiaoguang wxiaoguang added the skip-changelog This PR is irrelevant for the (next) changelog, for example bug fixes for unreleased features. label Feb 14, 2024
@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Feb 17, 2024

func fatalDuplicatedPath(name, p string) {
if targetName, ok := uniquePaths[p]; ok && targetName != name {
log.Fatal("storage path %q is being used by %q and %q and all storage paths must be unique to prevent data loss.", p, targetName, name)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't it suffice to convert the Fatal to an Error for now?
I know, it doesn't fix the problem completely, but it would be an improvement already…

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then it comes to the same question:

  • How many users really care about the startup logs .... I have answered many questions about "why something doesn't work" but the startup log already told users.
  • What an user could do if they see such message. Any document or guideline?

Copy link
Member

@delvh delvh Feb 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let me throw the ball right back at you:
Yes, it is in no way a complete solution, I've understood that already.

However, what is better?

  • Keeping a fix that while not perfect does work at scaring (some) people from shooting themselves in the foot
  • Disabling this check completely because we don't have any idea what recovery measures are available

That's exactly the problem: Everyone who has this problem has to decide how to proceed best themselves.
Gitea does not know which file belongs where. That's the original problem we want to fix.
I don't see any other way than letting each affected admin decide what should be moved where.

I'm in favor of at least keeping the log.Error.
Originally, before you notified me that all Docker users have this problem by default, I would have even argued for Fatal, but that's a valid problem that we have caused ourselves.
As such, we cannot Fatal anymore, but we can at least make every user (that reads the logs) aware of the problem.

And in the meantime, we can work on a better fix.

modules/setting/server.go Outdated Show resolved Hide resolved
modules/setting/server.go Show resolved Hide resolved
@lafriks
Copy link
Member

lafriks commented Feb 19, 2024

I do not agree with this revert, if there are invalid or missing checks they should be fixed but gitea should still fail to start with invalid configuration that could lead to data loss

@wxiaoguang
Copy link
Contributor Author

I do not agree with this revert, if there are invalid or missing checks they should be fixed but gitea should still fail to start with invalid configuration that could lead to data loss

What's your suggestion to address these concerns?

Discussion: #26484 (comment) and #26484 (comment)

wxiaoguang

This comment was marked as outdated.

@wxiaoguang
Copy link
Contributor Author

wxiaoguang commented Feb 19, 2024

Let me re-explain my opinion here: I proposed to revert that change, not because of its purpose, but because of various problems of it:

  1. No test, no document.
  2. Users who are affected by the "Fatal" could do nothing, no guideline.
  3. Some code like AppWorkPath is totally wrong. Wrong code + Wrong code makes a working result, I do not think it is acceptable.

Anyway, I don't have enough time at the moment. So I will close this revert. Leave the documentation / wrong code to people have time to fix (I might have time in the future, but not now ....)

@wxiaoguang wxiaoguang closed this Feb 19, 2024
@GiteaBot GiteaBot removed this from the 1.22.0 milestone Feb 19, 2024
Copy link

Automatically locked because of our CONTRIBUTING guidelines

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 28, 2024
@lunny lunny reopened this Mar 29, 2024
@github-actions github-actions bot added the modifies/go Pull requests that update Go code label Mar 29, 2024
@lunny
Copy link
Member

lunny commented Mar 29, 2024

I think this revert is still necessary before the v1.22 stable release. It may prevent many instances from starting. We can revert this one and rework the PR because fixing it is very complicated. If no obvious objection, I will merge it in a week.

@wxiaoguang
Copy link
Contributor Author

I made a new one: Refactor startup path check #30169

@wxiaoguang wxiaoguang closed this Mar 29, 2024
@wxiaoguang wxiaoguang deleted the revert-path-check branch March 29, 2024 07:50
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lgtm/need 1 This PR needs approval from one additional maintainer to be merged. modifies/go Pull requests that update Go code size/M Denotes a PR that changes 30-99 lines, ignoring generated files. skip-changelog This PR is irrelevant for the (next) changelog, for example bug fixes for unreleased features.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants