Ordered loader: a page-capping provider loses a moved row from a joined window after refetch
Mantenedores costumam responder em até 1 dia
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 4/5
- Tempo estimado
- 3-5 dias
- Facilidade para iniciantes
- 18/100
- Tipo de issue
- Bug
- Clareza
- Claramente especificada
- Status de atividade
- Ativa
- Stack de tecnologia
- typescript
- Domínio
- databases
Direção de pesquisa
Start with the pinned it.fails test in packages/query-db-collection/tests/refetch-ordered-prefix-oracle.test.ts, which encodes the eight-step history against a provider with pageCap 2. Run it to see the failure 'window after refetch at step 3 was []; expected [7]', then trace where the ordered loader's repair path treats a short page as exhaustion. Read PR #2154 on branch fix-query-db-refetch-ordered-gap first. Done when the test passes without the it.fails marker and the refetch oracle's generated scenarios accept pageCap.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
Summary
With a provider that returns fewer rows than a request's limit (a page cap), an on-demand joined ordered window can lose a row after a refetch. The row's order changed, and the loader's own repair drops it. A short reply does not prove that the source is exhausted (glossary), so the loader must keep reading.
Reproduction
The pinned witness is a capped provider keeps a moved row in the window after a refetch (known loader defect) in packages/query-db-collection/tests/refetch-ordered-prefix-oracle.test.ts (branch fix-query-db-refetch-ordered-gap, PR #2154). It is an it.fails test today.
- Provider: cursor encoding,
pageCap: 2. - Query:
rank desc,offset 1,limit 2, LEFT-joined marker filter. - Initial rows: id 0 (rank 1, marked), id 1 (rank 0, unmarked).
- History:
- Mark id 7.
- Upsert id 2 at rank 1.
- Upsert id 7 at rank 0.
- Refetch.
- Delete id 3.
- Invalidate.
- Upsert id 3 at rank 1.
- Upsert id 0 at rank 0.
Failure: window after refetch at step 3 was []; expected [7].
Scope
This reproduces on main, through the loader's own repair. It is separate from #2136. The query-db refetch oracle's generated campaigns use an uncapped provider because of this defect. A page-capped trace together with a peer live query also fails (found while #2154 was reviewed). That trace fails the same way with the loader's first-page skip disabled.
Suggested witness and owner
- Owner: the ordered loader. The repair and continuation path must treat a short page as "not exhausted".
- Witness: flip the pinned
it.failstest, then addpageCapto the query-db refetch oracle's generated scenario.
This issue was written by Isaac.
- Linguagem predominante
- TypeScript
- Estrelas
- 4k
- Forks
- 277
- Merge médio
- 17h 40min
- PRs com merge (30d)
- 223
Preparar o ambiente
- Sem Dockerfile nem arquivo Docker Compose
- Tem um modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de TanStack/db
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 82/100
Mantenedores costumam responder em até 1 dia
-
Garbage collection cleans up a collection while one of its transactions is still persistingTalvez já em andamento @Nabil372 assumiu há 1 dia. Aberta
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 35/100
Mantenedores costumam responder em até 1 dia
-
persistedCollectionOptions without a schema can't be passed to createCollection (follow-up to #1452)Aberta
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 68/100
Mantenedores costumam responder em até 1 dia
Todas as issues de TanStack/db
Issues semelhantes
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
grafana/profiles-drilldown#1212 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
grafana/traces-drilldown#980 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 76/100
openremote/openremote#3487 · 1 comentário ·
-
triage:needs-human
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 67/100
garrytan/gbrain#7635 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 82/100
coollabsio/jean#867 ·
Mantenedores costumam responder em até 1 dia