nickva commented on issue #6175:
URL: https://github.com/apache/couchdb/issues/6175#issuecomment-6352783048
This reproduces it in a dev cluster
```shell
#!/bin/sh
# Missing stub bug.
#
# Whole update fails with 412 if we send {"stub": true} when one shard copy
is
# live but hasn't commited the previous revision yet. It throws missing which
# blow up the coordinator regardless of whatever other reponses are (so we're
# not doing the quorum thing).
# 1. Use a dev cluster with 3 nodes
# 2. Make node3 slow:
#
# - On top of the handle_info({update_docs, ...}, Db) clause in
couch_db_updater.erl:
#
# case
# node() =:= '[email protected]' andalso not ReplicatedChanges andalso
# mem3:dbname(Db#db.name) =:= ~"db"
# of
# true -> timer:sleep(10000);
# false -> ok
# end,
#
# 3. Set `serialize_worker_startup = false` in rel/overlay/etc/default.ini
#
# 4. ./dev/run -n 3 -a adm:pass and run this script
set -eu
h() {
http --ignore-stdin --print=b --pretty=none "$@"
}
DB=http://adm:[email protected]:15984
DB3=http://adm:[email protected]:35984
h delete $DB/db > /dev/null
h put $DB/db q==8 n==3
# create though n1, update through slower n3
INLINE='{"a.txt":{"content_type":"text/plain","data":"cG90YXRv"}}'
STUBBY='{"a.txt":{"content_type":"text/plain","revpos":1,"stub":true}}'
echo "==== stubby ===="
for i in $(seq 5); do
REV=$(h put $DB/db/doc$i _attachments:="$INLINE" | jq -r .rev)
h put $DB3/db/doc$i _rev=$REV a:=42 _attachments:="$STUBBY"
done
echo "===== get revs (2-... after error means other copies got the writen)"
for i in $(seq 5); do
h get $DB/db/doc$i | jq -r '"\(._id) \(._rev)"'
done
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]