AnswerDotAI / AnswerDotAI/sqlite-minutils

With manual transactions, race conditions on `last_insert_rowid()` need to be accounted for

オープン
#21 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
Python
スター
17
フォーク
9
PR マージ指標
30日以内にマージされた PR はありません

説明

## Race condition scenario with new configuration:

```python
# pseudocode

# We insert the record here!
db.insert(...)

# ! Record adding in different process increments the ROWID by another one

# Let's see the last PK, but now it's been incremented 0-to-many times
print(db.last_pk)
```

## Probably not a fix

```python
db.begin()
db.insert(...)
print(db.get_last_rowid()) # Not necessarily the record
db.commit()
```

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

調査の方向性

まず、issue に記載されている db.insert、db.last_pk、db.get_last_rowid のエントリポイントを追跡し、次に手動トランザクションが同時実行プロセスとどのように相互作用するかを確認します。pseudocode に示されたインターリービングを再現し、完全な修正またはテストで何をカバーすべきかを決める前に、主キーに期待される動作を確立します。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
python, sqlite
領域
databases
issue の種類
バグ
難易度
5/5
見積もり時間
1週間以上
活発さ
停滞
明瞭さ
説明が足りない
初心者へのやさしさ
25/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。