A retried `upsert` inserts a key that a concurrent writer already inserted
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
- 54/100
Direção de pesquisa
Start by tracing the upsert commit retry and _FastAppendFiles._validate_concurrency; the issue says that path currently fails to detect a concurrent insert. Reproduce the two-writer example with the supplied SQLite catalog and PyArrow table, then compare the behavior with version 0.11.1. Done means a retry does not leave duplicate keys, and concurrent add_files does not register the same file twice.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
Apache Iceberg version
0.12.0 (latest release)
Please describe the bug 🐞
Currently, a commit retry replays the upsert's append, and _FastAppendFiles._validate_concurrency checks nothing, so a key another writer inserted after the read is inserted a second time. 0.11.1 raises CommitFailedException here.
import tempfile
import pyarrow as pa
from pyiceberg.catalog.sql import SqlCatalog
from pyiceberg.schema import Schema
from pyiceberg.types import LongType, NestedField, StringType
cat = SqlCatalog("c", uri="sqlite:///:memory:", warehouse=f"file://{tempfile.mkdtemp()}")
cat.create_namespace("ns")
schema = Schema(NestedField(1, "k", LongType(), required=True), NestedField(2, "v", StringType()), identifier_field_ids=[1])
t = cat.create_table("ns.t", schema=schema)
row = lambda k, v: pa.Table.from_pylist([{"k": k, "v": v}], schema=schema.as_arrow())
t.append(row(1, "a"))
a = cat.load_table("ns.t")
b = cat.load_table("ns.t")
b.upsert(row(2, "b"))
a.upsert(row(2, "a"))
# Commit failed due to a concurrent update, retrying (1/4) in 106 ms
print(sorted(cat.load_table("ns.t").scan().to_arrow().to_pylist(), key=str))
# [{'k': 1, 'v': 'a'}, {'k': 2, 'v': 'a'}, {'k': 2, 'v': 'b'}], should hold k 2 once
Two writers calling add_files on the same file register it twice the same way, and every row in it reads back twice.
tested on pyiceberg 0.12.0 and main
Willingness to contribute
- I can contribute a fix for this bug independently
- I would be willing to contribute a fix for this bug with guidance from the Iceberg community
- I cannot contribute a fix for this bug at this time
- Linguagem predominante
- Python
- Estrelas
- 1.2k
- Forks
- 654
- Merge médio
- 2d 11h
- PRs com merge (30d)
- 122
Preparar o ambiente
- Sem Dockerfile nem arquivo Docker Compose
- Tem um modelo de pull request
- Sem 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 apache/iceberg-python
-
`inspect.files()` and the other file metadata tables raise `ArrowInvalid` when a snapshot has no manifestsTalvez já em andamento @YuangGao assumiu há 10 dias. Abertakind:bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
apache/iceberg-python#4269 ·
Mantenedores costumam responder em até 1 dia
-
`inspect.entries()` raises TypeError when a data file has no column_sizesTalvez já em andamento @Rahul-cs50 assumiu há 14 dias. Abertakind:bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
apache/iceberg-python#4186 · 2 comentários ·
Mantenedores costumam responder em até 1 dia
-
`older_than` reads a naive datetime as UTC and expires snapshots it should keepTalvez já em andamento @Rahul-cs50 assumiu há 13 dias. Abertakind:bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
apache/iceberg-python#4182 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
REST: Send empty first-page pageToken when rest-page-size is setTalvez já em andamento @ehddnr301 assumiu há 32 dias. Abertakind:bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 82/100
apache/iceberg-python#4096 ·
Mantenedores costumam responder em até 1 dia
-
PyArrowFileIO: every small S3 write is a 3-request multipart upload; expose allow_delayed_openTalvez já em andamento @David-Banquet assumiu há 29 dias. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 70/100
apache/iceberg-python#4093 · 3 comentários ·
Mantenedores costumam responder em até 1 dia
Todas as issues de apache/iceberg-python
Issues semelhantes
-
bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 80/100
glossyio/traffic-monitor#312 ·
Mantenedores costumam responder em até 1 dia
-
local devenv exampleAbertadocumentation enhancement
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 76/100
es-ude/elastic-ai.creator#1046 ·
Mantenedores costumam responder em até 3 dias
-
ENH: permit cachetools >= 7Abertafeature request
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 65/100
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
confident-ai/deepteam#306 ·
Mantenedores costumam responder em até 1 dia
-
SslLibrary crashes with unhandled OSError: port/proto not found on non-standard SSL portsTalvez já em andamento @himanchalkaushale assumiu hoje. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 82/100
OWASP/Nettacker#1884 · 1 comentário ·
Mantenedores costumam responder em até 1 dia