tarantool / tarantool/tarantool-python

`load_schema` race

未关闭
#333 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

主要语言
Python
星标
108
派生
51
平均合并
1 天 8 小时
30 天内合并 PR
1

描述

These lines result in an index exception, trying to connect to the instance that actively applies DDL due to the race with the tarantool object creation:

https://github.com/tarantool/tarantool-python/blob/28310fc4e927c77d3be75e98360bf3b09f72482a/tarantool/connection.py#L1409-L1410

As these two fetches are non-transactional, the second one can return an index for space that is not fetched at the first fetch, resulting in:

Traceback (most recent call last):
  File "/python/lib/python3.11/site-packages/tarantool/connection.py", line 1097, in connect
    self.load_schema()
  File "/python/lib/python3.11/site-packages/tarantool/connection.py", line 1316, in load_schema
    self.schema.fetch_index_all()
  File "/python/lib/python3.11/site-packages/tarantool/schema.py", line 377, in fetch_index_all
    SchemaIndex(row, self.schema[row[0]])

贡献指南

这个仓库没有索引到贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

从 tarantool/connection.py 中 1409-1410 附近的链接行开始,然后跟踪 load_schema 到 tarantool/schema.py,并在失败的调用处检查 fetch_index_all。复现 Tarantool 对象并发创建的情况,并检查两次非事务 fetch 如何相互作用。当 load_schema 不再引发索引异常并处理一致的 schema 时,即表示完成。

由索引模型根据 Issue 内容生成。

评估

技术栈
python
领域
database
Issue 类型
缺陷
难度
3/5
预计耗时
1-2 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
48/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。