現象:開發機遷移(公司 IP 10.182.216.189 → 家庭 IP 192.168.0.51),XA 事務提交拋出:
RollbackException: SubCoordinator 'server_2+10.182.216.189:7021+driver_test_domain+t3+' not available
PropagationContext 中攜帶的 scURLs 為新 IP,但協調者內部仍持有舊 IP 的 CoordinatorDescriptor。
StoreTransactionLoggerImpl.recover() 讀取舊 TLOG,為 server_2 創建 ServerCoordinatorDescriptor(URL 含舊 IP),放入 CoordinatorDescriptor.knownServers(以 domain+serverName 為 Key)。scURL,解析出相同 ServerID (driver_test_domain+server_2),getOrCreateSCInfo() 誤認為已存在,直接復用舊 SCInfo(含不可用的舊 IP Stub)。// CoordinatorDescriptor.getOrCreate() 僅按 ServerID 去重
static CoordinatorDescriptor getOrCreate(String aCoURL) {
CoordinatorDescriptor cd = (CoordinatorDescriptor) knownServers.get(getServerID(aCoURL));
if (cd == null) cd = new CoordinatorDescriptor(aCoURL);
return cd;
}
// ServerID = domainName + serverName,忽略 IP/Port
final boolean representsCoordinatorURL(String aCoURL) {
return getServerID().equals(getServerID(aCoURL));
}
$DOMAIN_HOME/servers/server_2/data/store/.../tlog)重啟,強制重建描述符,問題即時恢復。ServerCheckpoint 恢復日誌,及早發現描述符不匹配。representsCoordinatorURL 比較納入 IP/Port,或提供 migrateCoordinatorDescriptor 管理操作。🔍 此問題本質是 邏輯標識與物理端點解耦不徹底。WebLogic 以 Domain+ServerName 為邏輯身份,卻在 TLOG 恢復時固化物理端點,缺乏端點變更感知機制。