Repository navigation
Fix broken async INSERT under a KEYED BY client_key quota - #122296
Conversation
|
Workflow [PR], commit [331fe93] Summary: ✅
AI ReviewSummaryThis PR carries Findings❌ Blockers
Final VerdictRequest changes. The LLVM Coverage ReportMeasured on commit 331fe93.
Changed lines: Changed C/C++ lines covered: 30/37 (81.08%) · Uncovered code |
69436a3 to
5f9ddb6
Compare
| client_info.current_user, | ||
| client_info.initial_user, | ||
| client_info.authenticated_user, | ||
| client_info.quota_key, |
There was a problem hiding this comment.
ContextAccessParams still derives quota selection from client_info.current_address and client_info.getLastForwardedForHost() (src/Access/ContextAccessParams.cpp:43-45), but this queue key only starts carrying quota_key. Two async inserts from the same user/query/settings but different client IPs still build the same InsertQuery, coalesce into one batch, and then flush under whatever address the background context has, so KEYED BY ip_address / KEYED BY forwarded_ip_address quotas are still charged and enforced against the wrong bucket. Please carry the address / forwarded-for fields through InsertQuery, fold them into the hash/equality key, and replay them on insert_context alongside setQuotaClientKey.
There was a problem hiding this comment.
The current_address can differ for the NAT cases. I am pretty sure we don't care about ip_address and forwarded_ip_address.
5f9ddb6 to
331fe93
Compare
|
Dropped the 5f9ddb6 since it's already fixed in the master |
Build profile diff (arm_release)Comparing ✅ No significant changes. Binary sizes
The official master build is compiled with Compile time of recompiled translation units16 translation units recompiled, 149 s compile time in total, 16 of them have a recent master baseline. |
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Fixed asynchronous
INSERTunder a quotaKEYED BY client_key: the flush ran without the client's quota key, so it failed withQUOTA_REQUIRES_CLIENT_KEY(or charged the wrong bucket). The quota key is now carried through the async batch and restored on flush, and background quota recomputes no longer log a spuriousQUOTA_REQUIRES_CLIENT_KEYerror.Note
A side quest generated during development in #111663
Workflow [PR]
Sync PR [sync-upstream/pr/122296]
Version info
26.10.1.1150-master(included in26.10and later)