mirror of
https://github.com/taylanbakircioglu/haproxy-openmanager.git
synced 2026-09-18 16:45:19 +00:00
1ea1c6a29f
This commit consolidates multiple improvements from internal development: ## Agent Stability Improvements - Add database connection pooling (min=10, max=50) for better performance - Prevent config reapply on agent restart by fetching last_applied_version from database - Optimize SSL fetch to only run when config changes (98% API call reduction) - Make SSL_SYNC_TIMESTAMP_FILE agent-specific to prevent race conditions - Fix agent offline display issue due to database connection bottleneck - 10x faster heartbeat response (200ms → 20ms) ## Bulk Import UPSERT Support - Parse endpoint detects existing entities (New/Existing status) - Bulk-create supports UPDATE for existing backends/frontends (merge strategy) - New servers can be added to existing backends - Existing servers preserved (no deletion in MVP) - Field-by-field value comparison (only changed fields updated) - Pending apply conflict prevention (409 error) - Fixed duplicate key error on server INSERT - Backend marked PENDING when servers added ## Apply Management Fixes - Fixed deleted entities not showing (include_inactive parameter) - Backend/Frontend GET endpoints support inactive entities for Apply Management - All pending changes now visible - Phantom backend bug protection maintained ## Backend Delete Improvements - Automatically clean ACL/use_backend rules from frontends - Prevents HAProxy validation errors after backend deletion - Frontend references automatically updated ## UI/UX Improvements - Cluster selector status dot auto-refreshes every 30 seconds - Real-time agent health monitoring (no page refresh needed) - Parse message shows only NEW entities (cleaner) - Status labels: 'Update' → 'Existing' (clearer meaning) - Multi-line parse success messages - Detailed summary breakdown with tooltips Technical Changes: - backend/database/connection.py: Connection pool implementation - backend/main.py: Pool initialization and cleanup - backend/routers/*: UPSERT logic, field comparison, include_inactive - backend/utils/agent_scripts/*: Applied version tracking, SSL optimization - frontend/src/components/*: UI improvements, status indicators - frontend/src/contexts/ClusterContext.js: Auto-refresh agent health Impact: - Supports 50+ concurrent agents (previously ~10) - Zero config reapply on restart/upgrade - Bulk import handles existing entities correctly - All pending changes visible in Apply Management - Real-time cluster health status - No HAProxy validation errors after backend delete