Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,6 @@ suite("test_insert_visible_timeout_return_mode", "nonConcurrent") {

def tableName = "test_insert_visible_timeout_return_mode_tbl"
def debugPoint = "PublishVersionDaemon.stop_publish"
// Use the configured FE HTTP endpoint so the case also works when SHOW FRONTENDS exposes loopback addresses.
def feHttpAddress = context.config.feHttpAddress
def feHost = feHttpAddress.split(":")[0]
def feHttpPort = Integer.parseInt(feHttpAddress.split(":")[1])

// Prepare a single-replica table so publish blocking deterministically drives the visible timeout path.
sql """ DROP TABLE IF EXISTS ${tableName} FORCE """
Expand All @@ -43,9 +39,15 @@ suite("test_insert_visible_timeout_return_mode", "nonConcurrent") {
)
"""

def masterFe = sql_return_maparray("SHOW FRONTENDS").find { it.IsMaster == "true" }
assertNotNull(masterFe, "Could not find master FE")
def masterFeHost = masterFe.Host as String
def masterFeHttpPort = masterFe.HttpPort as int

try {
// Block FE publish so inserts can commit but remain non-visible until the debug point is removed.
DebugPoint.enableDebugPoint(feHost, feHttpPort, NodeType.FE, debugPoint)
// PublishVersionDaemon only runs on the master FE. Keep the SQL connection unchanged and
// inject the fault directly into the master identified by the same SHOW FRONTENDS snapshot.
DebugPoint.enableDebugPoint(masterFeHost, masterFeHttpPort, NodeType.FE, debugPoint)

sql """ SET insert_visible_timeout_ms = 1000 """

Expand All @@ -61,7 +63,7 @@ suite("test_insert_visible_timeout_return_mode", "nonConcurrent") {
}
} finally {
try {
DebugPoint.disableDebugPoint(feHost, feHttpPort, NodeType.FE, debugPoint)
DebugPoint.disableDebugPoint(masterFeHost, masterFeHttpPort, NodeType.FE, debugPoint)
} catch (Throwable e) {
logger.warn("Failed to disable debug point ${debugPoint}", e)
}
Expand Down
Loading