Files
haproxy-openmanager/backend
Taylan Bakırcıoğlu 001b467e42 FIX: Rejected bulk import data corruption
CRITICAL BUG FIX: Rejected bulk import entities were marked APPLIED

ROOT CAUSE:
- Bulk import versions (bulk-import-*) don't match entity-ID regex
- Final cleanup incorrectly marked all PENDING entities as APPLIED
- 594 entities (56 FE + 55 BE + 483 SRV) corrupted in production

SOLUTION:
1. Detect bulk import versions (bulk-import-*, restore-*)
2. Extract entity IDs from metadata bulk_snapshots
3. Verify rollback deleted entities (should be 0 remaining)
4. If rollback failed, force DELETE entities
5. Skip final cleanup for bulk import (entities already handled)

IMPACT:
- Prevents data corruption on rejected bulk imports
- Detects and auto-fixes failed rollbacks
- Maintains data integrity for multi-entity operations
- Preserves existing orphan cleanup for single-entity changes

TESTING:
- Bulk import + reject: Entities deleted (not APPLIED)
- Normal entity + reject: Status updated to APPLIED (rollback)
- Orphan entities: Cleaned only if safe (no bulk versions)

Ref: demo-cluster bulk-import-1763450049 issue
2025-11-18 21:58:05 +03:00
..
2025-10-27 12:14:03 +03:00
2025-10-27 12:14:03 +03:00
2025-10-27 12:14:03 +03:00
2025-10-27 12:14:03 +03:00
2025-10-27 12:14:03 +03:00
2025-10-27 12:14:03 +03:00
2025-10-27 12:14:03 +03:00
2025-10-27 12:14:03 +03:00