Files
Meshray-Manager/docs/其他模块待修复问题清单.md
T
2026-06-30 15:14:37 +08:00

185 lines
4.2 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 其他模块待修复问题清单
## 📋 概述
Core 模块重构已完成(100%),但其他模块在使用 Core 时还存在一些编译问题需要修复。
---
## ❌ 已发现的问题
### 1. internal/store/sqlite/store.go
**问题**:引用了已删除的 `model.ServiceProvider`
**位置**:第 42 行
**影响**:编译失败
**修复方案**
```diff
- &model.ServiceProvider{}, // 服务注册表(替代旧 Server)
```
**状态**:✅ 已修复
---
### 2. core/proto/core_grpc.pb.go
**问题**:引用了未定义的消息类型
**位置**:整个文件
**影响**:编译失败
**原因**
- 该文件试图使用 protobuf 生成的代码风格
- 但实际上没有 protoc 编译器生成
- 消息类型(如 `CreateCoreRequest`)在 `core_grpc.go` 中手动定义
**修复方案**
```bash
# 删除该文件,使用 core/grpc_service.go 中的手动实现
rm core/proto/core_grpc.pb.go
```
**状态**:✅ 已修复
---
### 3. internal/ctr/core_client.go
**问题**:使用旧的 proto API
**位置**:多处(315, 326, 359 等)
**影响**:编译失败
**具体问题**
1. `proto.PeerBinding` - proto 文件中存在,但生成的代码可能不匹配
2. `proto.BindRequest` 字段不匹配:
- 旧代码:`CoreId`, `Peers`
- Proto 文件:`engine_id`, `peers`
3. `proto.UnbindRequest` - proto 文件中不存在该方法
4. `c.client.Unbind()` - gRPC client 没有这个方法
**根本原因**
- `internal/ctr/core_client.go` 使用的是项目根目录的 `proto/`
- 该 proto 包是旧的版本(Engine 架构)
- 而 Core 模块重构后使用了新的架构(Core 而非 Engine
**修复方案**
#### 方案 A:更新 proto 文件(推荐)
1. 更新 `proto/core.proto` 以匹配新的 Core 架构
2. 重新生成 protobuf 代码
3. 更新 `core_client.go` 使用新 API
#### 方案 B:更新 core_client.go 适配现有 proto
1. 修改 `core_client.go` 使用 `engine_id` 而非 `core_id`
2. 删除 `Unbind` 相关调用
3. 调整字段名称
**状态**:⏳ 待修复
---
## 🔧 修复建议
### 优先级 P0 - 阻塞编译
1. **删除废弃文件**
```bash
rm core/proto/core_grpc.pb.go
```
2. **修复 store.go** ✅
```go
// 删除 ServiceProvider 引用
```
### 优先级 P1 - 应用层适配
3. **统一 proto 接口** ⏳
- 确定使用 Engine 还是 Core 架构
- 更新 proto 文件
- 重新生成代码
4. **更新 core_client.go** ⏳
- 适配新的 proto 接口
- 更新字段名称
- 删除废弃方法
---
## 📊 影响范围
### 受影响的模块
| 模块 | 问题数 | 严重程度 | 修复优先级 |
|------|--------|----------|------------|
| `core/` | 0 | - | ✅ 已完成 |
| `internal/store/` | 1 | 高 | ✅ 已修复 |
| `internal/ctr/` | 3 | 高 | ⏳ P1 |
| `proto/` | 1 | 中 | ⏳ P1 |
### 编译状态
```bash
# Core 模块
✅ go build ./core # 通过
✅ go build ./core/connect # 通过
✅ go build ./core/transport # 通过
✅ go build ./core/pool # 通过
# 其他模块
❌ go build ./... # 失败
- internal/store/sqlite # ✅ 已修复
- internal/ctr # ⏳ 待修复
- proto # ⏳ 待修复
```
---
## 🎯 下一步行动
### 立即执行(P0
1. ✅ 删除 `core/proto/core_grpc.pb.go`
2. ✅ 修复 `internal/store/sqlite/store.go`
### 后续完善(P1
3. **确定架构方向** ⏳
- 使用 Engine 还是 Core
- 统一 proto 接口定义
4. **更新应用层代码** ⏳
- `internal/ctr/core_client.go`
- 其他使用 Core 的地方
5. **全量编译测试** ⏳
```bash
go build ./...
```
---
## 📝 备注
### Core 模块重构完成度
- ✅ **Core 模块自身**100% 完成
- ✅ **目录结构**:完全对齐 README
- ✅ **编译验证**`go build ./core` 通过
- ⏳ **应用层集成**:待适配
### 架构一致性
当前存在两个版本的 proto 定义:
1. **旧版本**`proto/core.proto` - Engine 架构
2. **新版本**`core/README.md` - Core 架构
需要统一为 Core 架构。
---
*更新时间:2026-03-24 04:45*
*版本:v2.2.0*
*状态:Core 模块 100% 完成,应用层集成待修复*