starrocks-connector-for-apache-flink icon indicating copy to clipboard operation
starrocks-connector-for-apache-flink copied to clipboard

Analyze v1.2.11

Open zhangzhefang-github opened this issue 5 months ago • 2 comments

What type of PR is this:

  • [x] BugFix
  • [ ] Feature
  • [ ] Enhancement
  • [ ] Refactor
  • [ ] UT
  • [ ] Doc
  • [ ] Tool

Which issues of this PR fixes :

Fixes #438

Problem Summary(Required) :

问题描述

在Docker环境中使用StarRocks Flink连接器时,当配置 'load-url' = 'starrocks:8030' 时,StarRocks FE会将Stream Load请求重定向到 127.0.0.1:8040(BE节点),但这个地址在容器间网络中无法访问,导致连接失败。

触发场景

  • Docker/容器化环境部署
  • 使用StarRocks官方推荐的单一FE地址配置
  • Stream Load操作时FE重定向到BE节点

解决方案

  1. 新增ContainerAwareRedirectStrategy类:实现容器感知的HTTP重定向处理
  2. 自动地址转换:将localhost/127.0.0.1重定向自动转换为原始容器主机名
  3. 多节点支持:支持多BE节点的端口到主机名映射
  4. 向后兼容:保持现有非容器环境的正常工作

主要修改

  • ContainerAwareRedirectStrategy.java - 核心重定向策略实现
  • DefaultStreamLoader.java - 集成新的重定向策略
  • TransactionStreamLoader.java - 集成新的重定向策略
  • ContainerAwareRedirectStrategyTest.java - 完整的单元测试覆盖

Checklist:

  • [x] I have added test cases for my bug fix or my new feature
  • [x] This pr will affect users' behaviors
  • [x] This pr needs user documentation (for new or modified features or behaviors)
  • [x] I have added documentation for my new feature or new function

zhangzhefang-github avatar Jun 24 '25 09:06 zhangzhefang-github

Hi, all checks have passed. Could a maintainer please approve the workflow so this PR can proceed? Thanks in advance!

zhangzhefang-github avatar Jun 24 '25 09:06 zhangzhefang-github

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar Jun 24 '25 10:06 CLAassistant