two_phase_commitment
Joined 3 October 2024
Posts in the forum
-
Replied in Reader-writer locks and the writer who never gets in: a timeline
Databases know this problem well, which is why lock managers keep a queue and are careful about letting new shared locks jump ahead of a waiting exclusive one. A schema change that waits for a long-r…
-
Replied in A benchmark score is a measurement. Where are the error bars?
Small point on the bootstrap: resample the *examples*, as you do, not the predictions of each model independently, otherwise you throw away the pairing and your interval gets wider than it should. Yo…
-
Replied in I reported 97% accuracy and it was data leakage. A post-mortem.
The duplicates one has a database cousin: a join that quietly multiplies rows, then a "random" split that sends the copies to both sides. Check for unique keys across train and test before anything e…
-
Replied in Índices invertidos: cómo un buscador encuentra palabras sin leer los documentos
Nice summary. One thing worth adding for people coming from databases: this is why a `LIKE '%word%'` query cannot use an ordinary B-tree index but a full-text index can. The inverted index answers "w…
-
Replied in Why BM25 still beats a lot of clever things: term frequency saturation
When documents are all about the same length anyway (titles, tags, short product records), or when length itself is a signal of quality. For long free text you almost always want it above zero. The h…
-
Started Why BM25 still beats a lot of clever things: term frequency saturation
If you query a text index and the ranking looks sensible, there is a good chance it is BM25 underneath. The formula looks scary but it encodes three simple ideas. ``` score(D, Q) = sum over terms q …
-
Replied in Characterization tests: how to touch code nobody understands
In database land the same thing: capture the result set of the important queries before a schema change, and compare after. I once caught a collation difference that sorted accented names differently…
-
Replied in "Exactly-once delivery" is at-least-once plus a dedup you must design
This is the happy cousin of two-phase commit: instead of coordinating two systems atomically, you make the second one safe to repeat. The commitment is one-sided, and it works.
-
Replied in A 20-line TLA+ spec finds the lost update before you write the code
I turned my last design review into a spec like this for the transaction retry logic. Found a lost update in the first run. The design had been "approved" by five people, myself included.
-
Started NOT IN with a NULL silently returns zero rows
A query that has hurt more people than any "advanced" feature: ```sql SELECT * FROM orders WHERE customer_id NOT IN (SELECT id FROM blocked_customers); ``` It works for months. One day `blocked_cus…
-
Started Two-phase commit: all the commitment issues, none of the closure
Hi, DBA here, and yes, the handle is a cry for help. Let me explain why two-phase commit (2PC) has a reputation. The goal: a transaction touches two databases, and both must commit or neither. A coo…