Repository navigation
Conversation
get_key_value_detail_in_db 等单键操作打到非所属 master 时报 'Moved: <slot> <host:port>'。新增通用 with_moved_retry 包装器: 解析 MOVED → 直连目标节点(按端点缓存连接)重试一次。 覆盖 set/del(standalone)/expire/persist/rename/hset/hdel/ lpush/rpush/lset/sadd/srem/zadd/zrem/get_key_value_detail 全部 单键 *_in_db 入口。控制台原始命令保持直连(写命令重放有副作用)。 本地 3 master 集群实测:跨节点 detail + EXPIRE 重定向正确。
云端记录按 updated_at 倒序下发且不区分类型,连接常先于其所属分组落地。 此时 local_workspace_id_for_cloud_id 仍为 None,连接被写到根目录, 且收尾只对齐分组的 parent_id,连接永远不会被纠正。 - ConnectionRepository 新增 update_workspace_id,刻意不改 updated_at,避免同步自身触发新上传 - workspace_hierarchy 新增 reconcile_connection_workspaces,仅在 sync_enabled 且本地未被改动时重新对齐 - finalize_pass 接入连接层级对齐,分组未落地时保留本地值 - 补充复现用例与层级对齐单测
- debug 构建默认数据根切到 ~/.navop-dev;--data-dir / --portable / NAVOP_DATA_DIR / NAVOP_PORTABLE 仍优先,显式覆盖不受影响 - 非安装模式跳过旧目录迁移与系统文件关联注册,并拒绝应用内安装更新 - 新增 Development 运行模式及 is_development/uses_installed_directories - 补充隔离目录、显式覆盖优先级、主密钥语义与目录准备测试
症状:连接后打开数据库,点刷新按钮必崩(Windows 11,v0.20.3 及之前)。 根因:树行右侧的加载中 spinner/错误图标是条件插入的无 id 子元素, 它们的出现与否改变后续兄弟元素的位置序号;gpui-fast 的布局 key 按路径+位置序号派生,序号漂移让计数/徽章文本的 key 在帧间变化, 测量保留缓存对不上号,prepaint 拿到未测量布局 panic (measurement has not been performed),release panic=abort 整进程退出。 修复:给行内动态文本容器(类型徽章/名称/键计数)加稳定 id, 不随兄弟条件插入漂移。与 #410 的行级 node_id 修复同族—— 那次修的是行 id,这次修的是行内元素 id。 回归测试:refreshing_a_loaded_database_does_not_crash(db4 种子键, 走 toolbar 刷新完整路径);空库切换用例改为 db 分离不再互踩。
直接 dev-dep redis_client 违反 main 的 direct_native_database_sdks_ are_optional_or_absent 契约测试,改用 RedisConnectionImpl::set_in_db。
SQL 执行成功后的缓存失效最终会删除文件缓存(`DbCache::clear_connection_cache` → `tokio::fs::remove_dir_all`),而 `tokio::fs` 内部经 `spawn_blocking` 依赖 `Handle::current()`,必须在 Tokio 运行时上下文内轮询。897a4c49b 把失效逻辑从 `Tokio::spawn_result` 搬到 GPUI 前台 `cx.spawn` 块内直接 await,失去运行时上下文 后触发 "there is no reactor running" panic;release 下 `panic = "abort"`,因此只要 有一条 DDL 成功执行(失效计划非空)就 SIGABRT。 - db: 新增 `GlobalDbState::apply_sql_cache_invalidation_plan_on_runtime`,沿用 `execute_session_on_runtime` 的 `Tokio::spawn_result` 约定,失败降级为空 scopes - db_view: `sql_result_tab` 立即失效、`sql_editor_view` 手动事务提交与会话关闭 三处前台调用改走运行时包装 - db_view: 新增源码契约测试,锁住前台必须走 `*_on_runtime` 包装这条约束
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
内容
2192baa76单 commit。背景
#414 后续反馈:升 v0.20.3 后集群 key 可见,但拉取值报
加载失败:Command error:TYPE失败。:An error was signalledby the server - Moved: 7243 192.168.60.142:7002上一轮只给 SCAN/批量 TYPE/DEL/dbinfo 做了集群处理,值加载链路(TYPE/TTL/LRANGE…)仍走单端点连接,无 MOVED 处理。
修复
with_moved_retry:解析 MOVED → 直连目标节点(cluster_conns按端点缓存)重试一次;同端点重复 MOVED 视为拓扑变动返回错误*_in_db入口:set/expire/persist/rename/hset/hdel/lpush/rpush/lset/sadd/srem/zadd/zrem/get_key_value_detail验证
redis-cli -p 7001 get跨节点键复现 MOVED;新测试cluster_moved_retry_redirects_single_key_ops验证跨节点 detail + EXPIRE 重定向正确