Skip to content

Bump go requirements to 1.24, refactor leadership, fixing k8s code to support latest versions, tests on github actions #926

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

Open
wants to merge 90 commits into
base: master
Choose a base branch
from

Conversation

ctrix
Copy link

@ctrix ctrix commented Mar 7, 2025

This is quite a massive change to the project.

I needed it to work on the latest vesions of postgres and i took this opportunity to update the code and refactor a bit.

Feel free to cherry pick and merge whatever you want.

nh2 and others added 30 commits April 13, 2023 17:52
…sion, when kube-api has a downtime, there will be a probability of connection timeout, and then can not select the master

Signed-off-by: bingbing ma <[email protected]>
Migrated from libkv APIs to kvtools/valkeyrie for KV backend operations. Updated imports, initialization logic, and context handling to align with the new library. Removed redundant import registrations and streamlined code for better maintainability.
This commit removes the etcdV3 store code and its integration with KV-backed elections. The support for etcdV3 is no longer required, simplifying the codebase and focusing on other store implementations.
Unified formatting for multi-line comments across files. Added explicit `//go:build` directives for platform-specific code and adjusted variable alignment for improved readability. These changes enhance code clarity and maintainability.
Massimo Cetra added 20 commits March 11, 2025 10:08
Standardize the use of store-specific constants for backend names, replacing hardcoded strings with predefined constants. Add a default case to validate unknown store backends, improving error handling. This helps maintain consistency and prevents misconfiguration issues.
Consolidated duplicate switch cases for cleaner and more concise code. This change improves maintainability by reducing redundancy in the logic for backend selection. Functionality remains unchanged.
Updated the autogenerated timestamp in multiple Stolon command documentation files to reflect the new generation date. This ensures consistency and clarity in the generated docs.
…ic operations are already guaranteed by the stdlib.

Removed the internal/timer package and updated all references to use Go's built-in time package. This simplifies the codebase by leveraging standard library utilities for time management and avoids maintaining redundant custom code.
…ollision)

Renamed the variable `url` to `c_url` in the ConsulConfig function to avoid shadowing the imported `url` package. This improves code clarity and prevents potential issues involving namespace conflicts. No changes were made to the function's logic or overall behavior.
Renamed variables for clarity and consistency (e.g., maj/min to vmaj/vmin). Improved context and parameter handling by replacing unused parameters with underscores. Added defensive checks for potential nil references to enhance reliability.
Simplified and standardized error messages for TCP address resolution and metrics server. Replaced unused function parameters with underscores to improve clarity. Added error suppression for listener closure to prevent potential runtime issues.
Introduced const groups for better organization of dbTypes, dbValidity, and dbStatus values. Simplified function signatures by replacing unused parameters with underscores. Added a harmless placeholder comment for the Converged case in db status handling.
…name collision)

Updated the variable name from 'cluster' to 'scluster' for clarity and to better reflect its purpose. This improves code readability and avoids potential confusion with other similarly named identifiers.
Replaced unused parameters in the versionCommand function with underscores for clarity and to adhere to Go conventions. This improves code readability and signals that the parameters are intentionally unused.
Replaced the named variable `cmd` with `_` to acknowledge it is unused. This improves code clarity and adheres to Go conventions for unused parameters. No functional changes introduced.
@sgotti
Copy link
Member

sgotti commented Mar 12, 2025

@ctrix Thanks for you work! It would be great, and simplify merging, if you could split the commits in multiple self-contained PRs (like: support postgres16, new kv store library) so I can easily review them, verify tests works and then merge them.

Massimo Cetra added 7 commits March 12, 2025 09:15
The -failfast flag ensures that testing stops at the first failure, making it easier to identify issues quickly. This change improves the debugging process, especially for large test suites.
```
Replace custom timer usage with standard time package in tests (tests should be included in the build)

Refactored the code to replace the usage of the internal `timer` package with the standard `time` package for consistency and readability. This change simplifies time-related logic and ensures adherence to standard Go practices. Removed the unnecessary timer import as part of the cleanup.
```
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.

None yet

3 participants