injectHeartbeat writing failed on teardown
- 主要言語
- Go
- スター
- 13.6k
- フォーク
- 1.4k
- 平均マージ
- 2時間 31分
- マージ済み PR(30日)
- 4
説明
Hi all!
Environment:
Azure Mysql Flexible Sever, 8.0.44-azure
gh-ost 1.1.8
We have an instance with a number of partitioned tables and a large schema metadata. With this setup, the dry run check fails with the following errors (from the first to the last):
```code
Closed streamer connection. err=
Dropping table `_ghc`
Table dropped
Error 1146 (42S02): Table '_ghc' doesn't exist
...
Error 1146 (42S02): Table '_ghc' doesn't exist
...
injectHeartbeat writing failed 61 times, last error: Error 1146 (42S02): Table '_ghc' doesn't exist
```
It appears that on slow disks/thousands of tables, [finalCleanup](https://github.com/github/gh-ost/blob/v1.1.8/go/logic/migrator.go#L1723) is executed too early and drops the table before [teardown](https://github.com/github/gh-ost/blob/v1.1.8/go/logic/migrator.go#L373) (where injectHeartbeat actually stops). And deleting a '_ghc' table takes longer than `default-retries` (60) * `heartbeat-interval-millis` (100 ms).
Currently, this can be fixed by increasing `default-retries` or `heartbeat-interval-millis` (or both), but this seems like a workaround.
Is it possible to fix the order of execution?
Thanks in advance!
コントリビューションガイド
調査の方向性
Start in go/logic/migrator.go at finalCleanup and teardown, then trace where injectHeartbeat is stopped during the dry-run flow. Reproduce with a slow cleanup or large schema and verify that heartbeat writes stop before the _ghc table is dropped, without the reported teardown errors.
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- go, mysql
- 領域
- database
- issue の種類
- バグ
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 活発さ
- 静か
- 明瞭さ
- 明確に書かれている
- 初心者へのやさしさ
- 58/100