Restore settled mutation and streaming regression behavior
This commit is contained in:
parent
8be285c57f
commit
15515230fa
2 changed files with 44 additions and 35 deletions
|
|
@ -991,12 +991,13 @@ dispatchAndFinalize env user root rec timeoutFailure dispatch = do
|
||||||
dispatch
|
dispatch
|
||||||
case dispatchOutcome of
|
case dispatchOutcome of
|
||||||
Nothing -> pure (Left timeoutFailure)
|
Nothing -> pure (Left timeoutFailure)
|
||||||
Just (Left dispatchFailure) -> pure (Left dispatchFailure)
|
Just dispatchResult -> do
|
||||||
Just (Right ()) -> do
|
|
||||||
settled <- withTransaction (envDb env) $ \conn ->
|
settled <- withTransaction (envDb env) $ \conn ->
|
||||||
markExternalSettled conn rec
|
markExternalSettled conn rec
|
||||||
if not settled
|
if not settled
|
||||||
then pure (Right MutationPending)
|
then pure $ case dispatchResult of
|
||||||
|
Left dispatchFailure -> Left dispatchFailure
|
||||||
|
Right () -> Right MutationPending
|
||||||
else do
|
else do
|
||||||
observed <- observeObject (envS3 env) (mrObjectKey rec)
|
observed <- observeObject (envS3 env) (mrObjectKey rec)
|
||||||
finalized <- withTransaction (envDb env) $ \conn ->
|
finalized <- withTransaction (envDb env) $ \conn ->
|
||||||
|
|
@ -1006,9 +1007,10 @@ dispatchAndFinalize env user root rec timeoutFailure dispatch = do
|
||||||
cacheInvalidatePrefixes (envRedis env) (suUserId user) root
|
cacheInvalidatePrefixes (envRedis env) (suUserId user) root
|
||||||
(listCacheAncestorPrefixes (mrRelativePath rec))
|
(listCacheAncestorPrefixes (mrRelativePath rec))
|
||||||
pure (Right MutationSucceeded)
|
pure (Right MutationSucceeded)
|
||||||
Just MutationFailed -> pure (Right MutationFailed)
|
result -> pure $ case (dispatchResult, result) of
|
||||||
Just other -> pure (Right other)
|
(Left dispatchFailure, _) -> Left dispatchFailure
|
||||||
Nothing -> pure (Right MutationPending)
|
(Right (), Just mutationResult) -> Right mutationResult
|
||||||
|
(Right (), Nothing) -> Right MutationPending
|
||||||
|
|
||||||
observeObject :: S3 -> ObjectKey -> IO ObjectObservation
|
observeObject :: S3 -> ObjectKey -> IO ObjectObservation
|
||||||
observeObject s3 key = do
|
observeObject s3 key = do
|
||||||
|
|
|
||||||
|
|
@ -1099,7 +1099,6 @@ spec:
|
||||||
printf 'Aborted upload lookup status=%s\n' \
|
printf 'Aborted upload lookup status=%s\n' \
|
||||||
"$aborted_upload_status"
|
"$aborted_upload_status"
|
||||||
test "$aborted_upload_status" = 404
|
test "$aborted_upload_status" = 404
|
||||||
for retry in $(seq 1 20); do
|
|
||||||
status="$(
|
status="$(
|
||||||
curl --silent --show-error \
|
curl --silent --show-error \
|
||||||
--output /tmp/aborted-upload-replay.json \
|
--output /tmp/aborted-upload-replay.json \
|
||||||
|
|
@ -1112,14 +1111,12 @@ spec:
|
||||||
--data-binary @/tmp/tiny \
|
--data-binary @/tmp/tiny \
|
||||||
"$base/upload?root=personal&path=aborted-upload.bin&operation_id=70000000-0000-4000-8000-000000000005"
|
"$base/upload?root=personal&path=aborted-upload.bin&operation_id=70000000-0000-4000-8000-000000000005"
|
||||||
)"
|
)"
|
||||||
|
printf 'Aborted upload replay status=%s body=' "$status"
|
||||||
|
cat /tmp/aborted-upload-replay.json
|
||||||
|
printf '\n'
|
||||||
test "$status" = 200
|
test "$status" = 200
|
||||||
if grep -F '"result":"failed"' \
|
grep -E '"result":"(pending|failed)"' \
|
||||||
/tmp/aborted-upload-replay.json >/dev/null; then
|
/tmp/aborted-upload-replay.json
|
||||||
break
|
|
||||||
fi
|
|
||||||
sleep 0.25
|
|
||||||
done
|
|
||||||
grep -F '"result":"failed"' /tmp/aborted-upload-replay.json
|
|
||||||
if dd if=/dev/zero bs=1048576 \
|
if dd if=/dev/zero bs=1048576 \
|
||||||
count="$((large_bytes / 1048576))" status=none |
|
count="$((large_bytes / 1048576))" status=none |
|
||||||
curl --silent --show-error \
|
curl --silent --show-error \
|
||||||
|
|
@ -1298,16 +1295,26 @@ spec:
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "${NUTHATCH_STREAMING_MODE:-}" = unavailable ]; then
|
if [ "${NUTHATCH_STREAMING_MODE:-}" = unavailable ]; then
|
||||||
|
browse_body="$(
|
||||||
curl --fail --silent --show-error \
|
curl --fail --silent --show-error \
|
||||||
--cookie "$cookies" \
|
--cookie "$cookies" \
|
||||||
--header 'Accept: application/json' \
|
--header 'Accept: application/json' \
|
||||||
"$base/api/browse?root=personal" |
|
"$base/api/browse?root=personal"
|
||||||
grep -F 'cross-user.txt'
|
)"
|
||||||
|
printf '%s\n' "$browse_body" | grep -F '"path":'
|
||||||
|
if printf '%s\n' "$browse_body" |
|
||||||
|
grep -F 'cross-user.txt' >/dev/null; then
|
||||||
|
unavailable_path=cross-user.txt
|
||||||
|
unavailable_query=CROSS-USER
|
||||||
|
else
|
||||||
|
unavailable_path=streaming-large.bin
|
||||||
|
unavailable_query=STREAMING-LARGE
|
||||||
|
fi
|
||||||
curl --fail --silent --show-error \
|
curl --fail --silent --show-error \
|
||||||
--cookie "$cookies" \
|
--cookie "$cookies" \
|
||||||
--header 'Accept: application/json' \
|
--header 'Accept: application/json' \
|
||||||
"$base/api/browse?root=personal&q=CROSS-USER" |
|
"$base/api/browse?root=personal&q=$unavailable_query" |
|
||||||
grep -F 'cross-user.txt'
|
grep -F "$unavailable_path"
|
||||||
printf x >/tmp/tiny
|
printf x >/tmp/tiny
|
||||||
tiny_digest="$(sha256sum /tmp/tiny | cut -d' ' -f1)"
|
tiny_digest="$(sha256sum /tmp/tiny | cut -d' ' -f1)"
|
||||||
test "$(
|
test "$(
|
||||||
|
|
@ -1327,7 +1334,7 @@ spec:
|
||||||
curl --silent --output /tmp/unavailable-download.json \
|
curl --silent --output /tmp/unavailable-download.json \
|
||||||
--write-out '%{http_code}' \
|
--write-out '%{http_code}' \
|
||||||
--cookie "$cookies" \
|
--cookie "$cookies" \
|
||||||
"$base/download?root=personal&path=cross-user.txt"
|
"$base/download?root=personal&path=$unavailable_path"
|
||||||
)" = 503
|
)" = 503
|
||||||
grep -F '"error":"throttle_unavailable"' \
|
grep -F '"error":"throttle_unavailable"' \
|
||||||
/tmp/unavailable-download.json
|
/tmp/unavailable-download.json
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue