Ordered window starts two full-source reads after a signalling refetch with a NaN boundary
Les mainteneurs répondent en général sous 1 jour
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 4/5
- Temps estimé
- 1-2 jours
- Accessibilité débutants
- 48/100
- Type d'issue
- Bug
- Clarté
- Plutôt claire
- Activité
- Active
- Stack technique
- typescript
Piste de recherche
Read ARCHITECTURE.md alongside the ordered-work oracle at packages/db/tests/query/ordered-work-oracle.property.test.ts, then reproduce the reported seed with the oracle and config from #2194 using the provided Vitest command. Trace why this counterexample starts two full-source reads after a signalling refetch and decide, according to ARCHITECTURE.md, whether the law or loader should change; done when the chosen behavior is justified and the reported assertion passes.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
Summary
An ordered live query issues two full-source reads after one signalling refetch. The law in the ordered-work oracle allows one. The window is descending with nulls: first, an anti-joined marker filters it, and one source row has a NaN rank, so the bounded boundary cannot be expressed.
The failure is on main. #2194 does not cause it. It changes the oracle's generator, so the seed reproduces only with the oracle file from #2194.
Law
The ordered-work oracle (packages/db/tests/query/ordered-work-oracle.property.test.ts) checks this rule: after a signalling refetch, the loader starts at most one full-source request. #2194 makes the law skip a bounded read that ends on a null or NaN rank, because ARCHITECTURE.md sends that boundary to the full-source fallback. Here the loader starts two full-source requests, not one.
Reproduce
- Check out
main(tested at 501b4813c). - Copy
packages/db/tests/query/ordered-work-oracle.property.test.tsandpackages/db/tests/oracle-config.tsfrom theordered-loader-ledgerbranch (#2194). - From
packages/db, run:
TANSTACK_DB_ORACLE_SEED=-1142653059 npx vitest run --coverage.enabled=false \
tests/query/ordered-work-oracle.property.test.ts \
-t "keeps rows and per-change work bounded"
Result:
AssertionError: full-source requests after a signalling refetch at step 2: expected 2 to be 1
Counterexample:
{"path":"on-demand","provider":"refetch-signal","latency":"immediate","cancellation":"cooperative","peer":false,"filter":"anti-joined","via":"marker","indexed":false,"direction":"desc","nulls":"first","terms":1,"limit":2,"offset":0,"initial":[{"id":0,"rank":0,"eligible":true},{"id":2,"rank":NaN,"eligible":true},{"id":1,"rank":0,"eligible":false}],"history":[{"type":"delete-visible"},{"type":"move","offset":0,"limit":1}]}
Open question
The cause is not known yet. There are two possible causes:
- The exemption in the law is too narrow for a
NaNrank at the start of a descending,nulls: firstorder. - The loader starts a second full-source read that it does not need.
A fix must decide which one, with ARCHITECTURE.md as the authority, before it changes the law or the loader.
This issue was written by Isaac.
- Langage dominant
- TypeScript
- Étoiles
- 4k
- Forks
- 277
- Merge moyen
- 17 h 33 min
- PR mergées (30 j)
- 227
Préparer son environnement
- Aucun Dockerfile ni fichier Docker Compose
- Propose un modèle de pull request
- Lire le guide de contribution
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 TanStack/db
-
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 82/100
Les mainteneurs répondent en général sous 1 jour
-
Electric: scoped move-in snapshots can prematurely resolve awaitTxId and remove optimistic rowsOuverte
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 4/5 1-2 jours Accessibilité débutants 48/100
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 4/5 1-2 jours Accessibilité débutants 48/100
Les mainteneurs répondent en général sous 1 jour
Toutes les issues de TanStack/db
Issues similaires
-
Difficulté 2/5 1-3 heures Accessibilité débutants 68/100
awesome-dsh-plugin/awesome-dsh-plugin#9184 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 75/100
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 85/100
farion1231/cc-switch#8829 ·
Les mainteneurs répondent en général sous 1 jour
-
[core-client] Remove unused hand-maintained transport helpers after the definition-table cutoverOuvertedoc-audit enhancement
Difficulté 2/5 1-3 heures Accessibilité débutants 88/100
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 85/100