6 Commits

Author SHA1 Message Date
anonpenguin23
db3ed5161d
Update Go module dependencies, enhance error handling, and implement sticky port allocation
- Updated Go version to 1.24.4 and adjusted toolchain.
- Added indirect dependencies for `go-spew` and `go-difflib`.
- Enhanced error handling in the `authMiddleware` to better distinguish between database errors and invalid API keys.
- Implemented sticky port allocation for database instances, allowing reuse of previously saved ports across restarts.
- Improved logging for port allocation and database recovery processes, ensuring better visibility and error tracking.
2025-10-16 15:23:20 +03:00
anonpenguin23
4d05ae696b
Add admin handlers for database creation and metadata management
- Introduced `admin_handlers.go` to handle database creation requests via HTTP, including validation and response handling.
- Implemented `db_metadata.go` to manage database metadata caching and synchronization with a pubsub subscriber.
- Updated `gateway.go` to initialize the metadata cache and start the metadata subscriber in the background.
- Added new route for database creation in `routes.go` to expose the new functionality.
- Enhanced cluster management to support system database auto-joining and improved metadata handling for database operations.
2025-10-16 10:56:59 +03:00
anonpenguin23
dd4cb832dc
Add memory leak prevention in pubsub handler and improve database recovery logic
- Implemented a cleanup goroutine in the pubsub handler to remove old entries from the recent connections map, preventing memory leaks.
- Enhanced the database recovery process in the cluster manager by adding checks for quorum and ensuring proper handling of existing data during instance startup.
- Updated instance management to clear Raft state for leaders with existing cluster state and added background SQL readiness checks for followers.
- Improved logging for better visibility during recovery and instance startup processes.
2025-10-16 10:10:33 +03:00
anonpenguin23
94248e40b0
Updated default advertise address to 0.0.0.0 in main.go, removed unnecessary BEGIN/COMMIT statements from migration SQL files, and improved database initialization handling in cluster manager. Increased wait times for node readiness and SQL availability checks to 60 seconds. 2025-10-14 13:59:36 +03:00
anonpenguin23
0bd9749aaf
Made clustering with system db work and replicate but migrations do not run 2025-10-14 12:59:24 +03:00
anonpenguin23
f2d5a0790e
started working on clustering 2025-10-13 07:41:46 +03:00