One rejected last_error can still roll back a whole batch (MySQL non-utf8mb4 charset; per-row update fallback)
Les mainteneurs répondent en général sous 1 jour
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 5/5
- Temps estimé
- Plus d'une semaine
- Accessibilité débutants
- 35/100
Piste de recherche
Start with OutboxProcessor.processNext, both store implementations, and 001__create_okapi_outbox_table.sql; compare the batch update transaction behavior with the two proposed options. Decide how row-level failures should preserve the other results, then add the latin1 MySQL test with one healthy entry and one emoji error. Done when the healthy entry remains DELIVERED and the rejected row follows the agreed retry behavior.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
Area: okapi-core OutboxProcessor, both stores, MySQL schema · Follow-up to: #130 / #140
Problem
OutboxProcessor.processNext still writes every result of a batch with one updateAfterProcessingBatch call inside the claim transaction. #140 removes the two known values the database rejected in last_error: values over 64 KB on MySQL, and NUL characters on Postgres. But any other rejected value in one row still rolls back the whole batch. Entries that were already delivered go back to PENDING with retries unchanged and are redelivered on every tick.
One more cheap trigger remains on MySQL. 001__create_okapi_outbox_table.sql creates okapi_outbox without an explicit CHARACTER SET, so the table inherits the schema or server default. On a schema that is still latin1 or utf8mb3, which is common on databases from the 5.7 era or migrated ones, a last_error with an emoji or any other character outside that charset fails in strict mode with ERROR 1366 Incorrect string value. The same applies to an HTTP error body or an exception message. The whole batch then rolls back again, delivered entries included. (I haven't reproduced this yet; MySQL 8 defaults to utf8mb4, which is why the tests don't hit it.)
Options
- Isolate per-row update failures (covers every cause). If the batch update throws, fall back to updating row by row. A row the database still rejects is written with a sanitized placeholder error, or skipped and left for the next tick with
retriesadvanced, so the other rows' results survive. On Postgres this needs a savepoint per row, because an error aborts the transaction. This changes the store/processor contract, so it needs a design decision. - MySQL charset. Add
DEFAULT CHARSET=utf8mb4for new installs, plus a changeset that converts existing tables (ALTER TABLE okapi_outbox CONVERT TO CHARACTER SET utf8mb4). The conversion rebuilds the table, so the rollout notes need to cover it. A cheaper, narrower option is to convert onlylast_error. - Sanitize to the column charset. Replace characters the column can't store before writing. This is fragile, because the store would need to know the column charset.
Option 1 fixes the class of problem; option 2 removes the known trigger. I'd do both, starting with option 2 because it is smaller.
Tests
- MySQL with a
latin1schema: a batch with one healthy entry and one whose error contains an emoji. The healthy entry staysDELIVERED. - For option 1: a store that rejects one row of a batch. The rest of the batch keeps its results, and the rejected row's
retriesadvances.
- Langage dominant
- Kotlin
- Étoiles
- 14
- Forks
- 0
- Merge moyen
- 9 h 54 min
- PR mergées (30 j)
- 11
Préparer son environnement
Ce projet ne fournit ni conteneur de développement, ni Dockerfile, ni guide de contribution : l'installation est à votre charge. Commencez par son README, et consultez notre guide de la première contribution pour les étapes générales.
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de softwaremill/okapi
-
OutboxProcessorListener events are emitted before the transaction commits; metrics over-count on commit failurePeut-être pris @rawo l’a pris aujourd’hui. Ouvertebreaking-change bug
Difficulté 4/5 3-5 jours Accessibilité débutants 35/100
softwaremill/okapi#137 ·
Les mainteneurs répondent en général sous 1 jour
-
enhancement
Difficulté 4/5 1-2 jours Accessibilité débutants 42/100
softwaremill/okapi#136 ·
Les mainteneurs répondent en général sous 1 jour
-
breaking-change bug
Difficulté 4/5 3-5 jours Accessibilité débutants 35/100
softwaremill/okapi#135 ·
Les mainteneurs répondent en général sous 1 jour
-
bug
Difficulté 3/5 Une demi-journée Accessibilité débutants 62/100
softwaremill/okapi#134 ·
Les mainteneurs répondent en général sous 1 jour
-
enhancement
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 22/100
softwaremill/okapi#133 ·
Les mainteneurs répondent en général sous 1 jour
Toutes les issues de softwaremill/okapi
Issues similaires
-
autoteam community connectors/destination/mssql connectors/source/hubspot team/use
Difficulté 2/5 1-3 heures Accessibilité débutants 77/100
airbytehq/airbyte#91201 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour
-
bug javascript
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
Les mainteneurs répondent en général sous 1 jour
-
Source: c7 Type: bug
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
-
2.23
Difficulté 2/5 1-3 heures Accessibilité débutants 65/100
ankidroid/Anki-Android#23042 · 4 commentaires ·
Les mainteneurs répondent en général sous 1 jour
-
[Submission] AI通话助手Ouvertesubmit-adaption submit-adaption-pre
Difficulté 1/5 Moins d'une heure Accessibilité débutants 88/100
BetterAndroid/android-notification-icon-project#828 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour