Thread: Concurrent update failure in HEAD
I found pgbench sometimes receives responces of "UPDATE 0" from HEAD server. When I re-tested pgbench with 8.4.2 server, all of the results were "UPDATE 1". Are there known issues in HEAD for concurrent updates? There were no problems if I used a few (1 or 2) connections, but 3 or more connections returns 0-UPDATEs. Since it also failed with -j1, multi-threading has nothing to do with the issue. So, there might be a bug in the server. I wrote the attached just for debugging. Strangely, even if it returns "UPDATE 0", I can retrive a row with the same condition after pgbench. $ pgbench -i $ pgbench -c3 -j1 -T10 starting vacuum...end. [0] miss update: UPDATE pgbench_branches SET bbalance = bbalance + :delta WHERE bid = :bid; => UPDATE 0 [0] variable: aid = 16625 [0] variable: bid = 1 [0] variable: delta = 1169 [0] variable: naccounts = 100000 [0] variable: nbranches = 1 [0] variable: ntellers = 10 [0] variable: scale = 1 [0] variable: tid = 1 $ psql -c "SELECT * FROM pgbench_branches WHERE bid = 1;" bid | bbalance | filler -----+----------+-------- 1 | -27026 | (1 row) I found the issue when I tested pg_stat_statements with pgbench. There were differences in 'calls' and 'rows' fields in it, but it should be same because pgbench always updates a row per query. Regards, --- Takahiro Itagaki NTT Open Source Software Center
Attachment
Takahiro Itagaki <itagaki.takahiro@oss.ntt.co.jp> writes: > I found pgbench sometimes receives responces of "UPDATE 0" from HEAD server. > When I re-tested pgbench with 8.4.2 server, all of the results were "UPDATE 1". > Are there known issues in HEAD for concurrent updates? I suspect it might have something to do with the recent EvalPlanQual rewrite, but exactly what the problem is is not clear. regards, tom lane
Takahiro Itagaki <itagaki.takahiro@oss.ntt.co.jp> writes: > I found pgbench sometimes receives responces of "UPDATE 0" from HEAD server. > When I re-tested pgbench with 8.4.2 server, all of the results were "UPDATE 1". > Are there known issues in HEAD for concurrent updates? There are now :-(. I've committed a fix that I think takes care of this, but since it seems to be a quite hard-to-reach path of control, please test some more. regards, tom lane
Tom Lane <tgl@sss.pgh.pa.us> wrote: > Takahiro Itagaki <itagaki.takahiro@oss.ntt.co.jp> writes: > > I found pgbench sometimes receives responces of "UPDATE 0" from HEAD server. > > When I re-tested pgbench with 8.4.2 server, all of the results were "UPDATE 1". > > Are there known issues in HEAD for concurrent updates? > > There are now :-(. I've committed a fix that I think takes care of > this, but since it seems to be a quite hard-to-reach path of control, > please test some more. Excellent! It worked perfenct and I don't see update failure anymore. I hope we will have additional regression tests to find such kind of bugs. Regards, --- Takahiro Itagaki NTT Open Source Software Center