Skip to content

Conversation

@ademidoff
Copy link
Member

@ademidoff ademidoff commented Oct 11, 2025

PMM-14305

Link to the Feature Build: SUBMODULES-4070

PR Summary
This pull request features the following changes:

  • improvements to database migration error handling
  • a partial migration from the deprecated github.com/pkg/errors package to the standard library errors package
  • clarification of logger context usage.

Error handling improvements:

  • Replaced usage of github.com/pkg/errors with the Go standard library errors package in both db.go and main.go, simplifying dependencies and modernizing error handling. [1] [2] [3] [4]

Database migration robustness:

  • Enhanced the runMigrations function in db.go to handle dirty migration states: if a migration fails and leaves the database dirty, it now attempts to force the migration version and re-run migrations, improving reliability during upgrades.

Logger context API clarification:

  • Updated documentation for Get in logger.go to clarify that SetEntry (not Set) must be called before retrieving a logger from context.
  • Removed the unused Set function from logger.go, streamlining the logger context API to only use SetEntry.

@ademidoff ademidoff force-pushed the PMM-14305-fix-clickhouse-dirty-state branch from c7c157a to d5914f6 Compare October 11, 2025 15:38
@ademidoff ademidoff force-pushed the PMM-14305-fix-clickhouse-dirty-state branch from d5914f6 to acc18de Compare October 11, 2025 15:42
@ademidoff ademidoff marked this pull request as ready for review October 11, 2025 15:54
@ademidoff ademidoff requested a review from a team as a code owner October 11, 2025 15:54
@ademidoff ademidoff requested review from BupycHuk and idoqo and removed request for a team October 11, 2025 15:54
}

// Set returns derived context with set logrus entry with given request ID.
func Set(ctx context.Context, requestID string) context.Context {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was unused.

@ademidoff ademidoff changed the title PMM-14305 Fix ClickHouse dirty state PMM-14305 Fix ClickHouse dirty migration state Oct 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants