Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

icingadb.DB: Retry Schema Checks #740

Merged
merged 1 commit into from
Apr 11, 2024
Merged

icingadb.DB: Retry Schema Checks #740

merged 1 commit into from
Apr 11, 2024

Conversation

oxzi
Copy link
Member

@oxzi oxzi commented Apr 11, 2024

During testing, I just encountered a race condition where my Galera cluster was not yet ready, causing the initial schema check to fail.

2024-04-11T08:13:40.401Z        INFO    icingadb        Starting Icinga DB daemon (1.1.1)
2024-04-11T08:13:40.401Z        INFO    icingadb        Connecting to database at 'mysql:3306'
2024-04-11T08:13:40.404Z        FATAL   icingadb        Error 1047 (08S01): WSREP has not yet prepared node for application use
can't check database schema version
github.com/icinga/icingadb/pkg/icingadb.(*DB).CheckSchema
        /go/src/github.com/Icinga/icingadb/pkg/icingadb/db.go:115
main.run
        /go/src/github.com/Icinga/icingadb/cmd/icingadb/main.go:74
main.main
        /go/src/github.com/Icinga/icingadb/cmd/icingadb/main.go:37
runtime.main
        /usr/local/go/src/runtime/proc.go:271
runtime.goexit
        /usr/local/go/src/runtime/asm_amd64.s:1695
exit status 1

This change now also retries the initial cluster check.

References #698.

@oxzi oxzi added the bug Something isn't working label Apr 11, 2024
@oxzi oxzi added this to the 1.2.0 milestone Apr 11, 2024
@oxzi oxzi requested review from lippserd and yhabteab April 11, 2024 08:34
@cla-bot cla-bot bot added the cla/signed label Apr 11, 2024
@oxzi oxzi requested a review from julianbrost April 11, 2024 08:36
@lippserd
Copy link
Member

lippserd commented Apr 11, 2024

We could also remove db#shouldRetry() as retry#Retryable() also handles driver.ErrBadConn.

lippserd
lippserd previously approved these changes Apr 11, 2024
@julianbrost
Copy link
Contributor

We could also remove db#shouldRetry() as retry#Retryable() also handles driver.ErrBadConn.

Is that combined with the thumbs up a sign that you want to do it now?

@lippserd
Copy link
Member

We could also remove db#shouldRetry() as retry#Retryable() also handles driver.ErrBadConn.

Is that combined with the thumbs up a sign that you want to do it now?

I would do that in a separate PR. @oxzi Can you take care of that please?

@oxzi
Copy link
Member Author

oxzi commented Apr 11, 2024

@julianbrost: The 👍 was just a general sign of "yeah, that's something that somebody should sometimes do". It seems like the burden fall onto me.

@oxzi oxzi marked this pull request as draft April 11, 2024 09:03
yhabteab
yhabteab previously approved these changes Apr 11, 2024
pkg/icingadb/db.go Outdated Show resolved Hide resolved
During testing, I just encountered a race condition where my Galera
cluster was not yet ready, causing the initial schema check to fail.

```
2024-04-11T08:13:40.401Z        INFO    icingadb        Starting Icinga DB daemon (1.1.1)
2024-04-11T08:13:40.401Z        INFO    icingadb        Connecting to database at 'mysql:3306'
2024-04-11T08:13:40.404Z        FATAL   icingadb        Error 1047 (08S01): WSREP has not yet prepared node for application use
can't check database schema version
github.com/icinga/icingadb/pkg/icingadb.(*DB).CheckSchema
        /go/src/github.com/Icinga/icingadb/pkg/icingadb/db.go:115
main.run
        /go/src/github.com/Icinga/icingadb/cmd/icingadb/main.go:74
main.main
        /go/src/github.com/Icinga/icingadb/cmd/icingadb/main.go:37
runtime.main
        /usr/local/go/src/runtime/proc.go:271
runtime.goexit
        /usr/local/go/src/runtime/asm_amd64.s:1695
exit status 1
```

This change now also retries the initial cluster check.

References #698.
@oxzi oxzi dismissed stale reviews from yhabteab and lippserd via fab2765 April 11, 2024 09:14
@oxzi oxzi force-pushed the retry-schema-check branch from d76f86f to fab2765 Compare April 11, 2024 09:14
@oxzi oxzi marked this pull request as ready for review April 11, 2024 09:14
@julianbrost julianbrost merged commit 889a153 into main Apr 11, 2024
31 checks passed
@julianbrost julianbrost deleted the retry-schema-check branch April 11, 2024 09:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working cla/signed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants