github / github/gh-ost

injectHeartbeat writing failed on teardown

Aberta
#1,663 1 comentário 0 reações 0 responsáveis Ver no GitHub
bug
Linguagem predominante
Go
Estrelas
13.6k
Forks
1.4k
Merge médio
2h 31min
PRs com merge (30d)
4

Descrição

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!

Guia de contribuição

Abrir o guia de contribuição

Direção de pesquisa

Comece em go/logic/migrator.go, em finalCleanup e teardown, e depois rastreie onde injectHeartbeat é interrompido durante o fluxo de dry-run. Reproduza com uma limpeza lenta ou um schema grande e verifique se as gravações de heartbeat param antes que a tabela _ghc seja removida, sem os erros de teardown relatados.

Escrita pelo modelo de indexação a partir do texto da issue.

Avaliação

Stack de tecnologia
go, mysql
Domínio
database
Tipo de issue
Bug
Dificuldade
3/5
Tempo estimado
1-2 dias
Status de atividade
Pouca atividade
Clareza
Claramente especificada
Facilidade para iniciantes
58/100

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.