injectHeartbeat writing failed on teardown
- Langage dominant
- Go
- Étoiles
- 13.6k
- Forks
- 1.4k
- Merge moyen
- 2 h 31 min
- PR mergées (30 j)
- 4
Description
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!
Guide de contribution
Ouvrir le guide de contribution
Piste de recherche
Commencez dans go/logic/migrator.go, au niveau de finalCleanup et teardown, puis suivez l’endroit où injectHeartbeat est arrêté pendant le flux de dry-run. Reproduisez le problème avec un nettoyage lent ou un schéma volumineux et vérifiez que les écritures de heartbeat s’arrêtent avant la suppression de la table _ghc, sans les erreurs de teardown signalées.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- go, mysql
- Domaine
- database
- Type d'issue
- Bug
- Difficulté
- 3/5
- Temps estimé
- 1-2 jours
- Activité
- Calme
- Clarté
- Clairement spécifiée
- Accessibilité débutants
- 58/100