Repository navigation
Conversation
…eftover files DROP DATABASE removes only the table files MariaDB knows about. A stray file in the schema directory, such as a MyISAM auto-recovery backup (<table>.MYD-<timestamp>.BAK written under myisam-recover-options=BACKUP), makes the final rmdir fail with error 1010 / errno 39. drop-site then aborts before dropping the site's database user and moving the site to archived, so the archive job fails even with force. At that point every table is already gone. With force, treat this error as non-fatal: drop the site's database users and move the site directory to sites/archived the same way drop-site would. Without force, or for any other drop-site error, the archive still fails as before. The emptied schema directory is left on the database server. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
|
This pull request does not currently match the merge queue conditions, so it cannot be queued from here. The box comes back if it matches again. |
|
Comment on lines
+466
to
+468
| hosts = self.execute(f"{mysql} -N -B -e \"SELECT Host FROM mysql.user WHERE User = '{database}'\"") | ||
| for host in hosts["output"].split(): | ||
| self.execute(f"{mysql} -e \"DROP USER IF EXISTS '{database}'@'{host}'\"") |
There was a problem hiding this comment.
When db_user differs from db_name, the fallback drops accounts named after the database instead of the site's actual user. It then archives the site and reports success while leaving that user behind. Pass Site.user separately and use it for both account queries.
Prompt To Fix With AI
This is a comment left during a code review.
Path: agent/bench.py
Line: 466-468
Comment:
**Archived site's user remains**
When `db_user` differs from `db_name`, the fallback drops accounts named after the database instead of the site's actual user. It then archives the site and reports success while leaving that user behind. Pass `Site.user` separately and use it for both account queries.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
A forced Archive Site job can fail at the database drop:
DROP DATABASEonly removes files MariaDB recognises as table files. Any other file in the schema directory stops the finalrmdir. One example is a MyISAM auto-recovery backup (__global_search.MYD-<timestamp>.BAK), which database servers write undermyisam-recover-options = BACKUP.bench drop-site --forceonly tolerates a failed backup, so it stops at this point. The site's database user is never dropped, the site directory never moves toarchived, and the job fails. If this happens in the archive step of a Site Migration, the whole migration fails after the site has already been restored on the destination.Change
In
Bench.bench_archive_site, whenforceis set and drop-site fails with this error (1010 / errno 39 on the site's own schema directory):mysql.userlookup), as drop-site would have done;sites/archived/<site>, using drop-site's numeric suffix when a site with that name was archived before.Without
force, or for any other drop-site error, the archive fails as before.Trade-off
The emptied schema directory, holding only the stray files, stays on the database server, and the schema still appears in
SHOW DATABASES. Removing it needs access to the database host, which the app server's agent doesn't have.Tests
Added to
agent/tests/test_site.py:🤖 Generated with Claude Code