Auto-switch HA readers do not handle unknown state ordinals safely
- Dominant language
- Java
- Stars
- 22.6k
- Forks
- 12k
- Avg merge
- 3d 1h
- Merged PRs (30d)
- 27
Description
### Description
The auto-switch HA server indexes HAConnectionState.values directly with the state ordinal read from the peer. An unknown ordinal throws ArrayIndexOutOfBoundsException in the read path. The HA client has the same unsafe lookup while reporting a mismatched master state.
### Expected behavior
Decode ordinals through a bounds-checked helper. Reject an unknown slave state and log an unknown master state without throwing from enum array access.
Contributor guide
Research direction
Start in the auto-switch HA server read path and the HA client path that reports a mismatched master state, locating the direct HAConnectionState.values lookups described in the issue. Trace how peer ordinals are decoded, then verify that unknown slave states are rejected and unknown master states are logged without an enum-array exception.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- distributed-systems
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 64/100