feat: able to set read preference to flownode (#6696)

fix: correctly compare the opened follower regions in startup

Signed-off-by: luofucong <luofc@foxmail.com>
This commit is contained in:
LFC
2025-08-08 17:08:09 +08:00
committed by GitHub
parent 3a2f5413e0
commit 253d89b5cc
9 changed files with 20 additions and 2 deletions

View File

@@ -8,4 +8,5 @@ license.workspace = true
workspace = true
[dependencies]
serde.workspace = true
strum.workspace = true

View File

@@ -12,11 +12,14 @@
// See the License for the specific language governing permissions and
// limitations under the License.
use serde::{Deserialize, Serialize};
use strum::{AsRefStr, Display, EnumString};
/// Defines the read preference for frontend route operations,
/// determining whether to read from the region leader or follower.
#[derive(Debug, Clone, Copy, Default, EnumString, Display, AsRefStr, PartialEq, Eq)]
#[derive(
Debug, Clone, Copy, Default, EnumString, Display, AsRefStr, PartialEq, Serialize, Deserialize,
)]
pub enum ReadPreference {
#[default]
// Reads all operations from the region leader. This is the default mode.