Conversation
|
Workflow [PR], commit [47daa95] Summary: ✅ AI ReviewSummaryThis PR adds a new Missing context
Findings❌ Blockers
ClickHouse Rules
Performance & Safety
Final Verdict
|
| } | ||
| else | ||
| { | ||
| if (args.empty() || args.size() > 3) |
There was a problem hiding this comment.
args.size() == 2 currently passes validation but silently ignores args[1] (username), because credentials are read only when args.size() >= 3.
That makes BACKUP ... TO URL(url, user) look accepted while actually sending unauthenticated requests, which is a correctness/safety footgun.
Please make the arity check strict (like S3): allow only 1 or 3 arguments in the non-named-collection path.
| std::unique_ptr<WriteBuffer> BackupWriterURL::writeFile(const String & file_name) | ||
| { | ||
| auto file_uri = getURIForFile(file_name); | ||
| return BuilderWriteBufferFromHTTP(file_uri) |
There was a problem hiding this comment.
writeFile doesn't apply remote_host_filter (reads use .withHostFilter(&context->getRemoteHostFilter()), writes do not).
This lets BACKUP ... TO URL(...) bypass host filtering for outbound write requests, while read paths are restricted.
Please add an explicit host-filter check for write targets (for example before creating the writer, and/or per-file URL in writeFile).
| file_uri.toString()); | ||
| } | ||
| } | ||
| catch (...) |
There was a problem hiding this comment.
This catch (...) swallows every network/protocol exception and only logs a warning.
As a result, backup cleanup can report success even when HTTP DELETE failed, because BackupImpl::tryRemoveAllFiles sees no exception from writer->removeFiles.
Other backup writers (S3, Azure, Disk) don't suppress deletion errors this way. Please propagate failures (except maybe explicit 404/not-found handling).
LLVM Coverage Report
PR changed lines: PR changed-lines coverage: 3.72% (11/296, 0 noise lines excluded) |
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Add backup engine URL().
Uploads and downloads files similar to table function
url():(the implementation is incomplete, don't review yet)