Skip to content

Commit b94420d

Browse files
added sqlName for maint queries (#405)
1 parent 1124f4b commit b94420d

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

lib/querybindblocker.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ func loadBlockQueryBind(db *sql.DB) {
160160
}
161161

162162
defer conn.Close()
163-
q := fmt.Sprintf("SELECT /*queryBindBlocker*/ %ssqlhash, %ssqltext, bindvarname, bindvarvalue, blockperc, %smodule FROM %s_rate_limiter where %smodule='%s'", GetConfig().StateLogPrefix, GetConfig().StateLogPrefix, GetConfig().StateLogPrefix, GetConfig().ManagementTablePrefix, GetConfig().StateLogPrefix, g_module)
163+
q := fmt.Sprintf("SELECT /*heraMgmt.QueryBindBlocker*/ %ssqlhash, %ssqltext, bindvarname, bindvarvalue, blockperc, %smodule FROM %s_rate_limiter where %smodule='%s'", GetConfig().StateLogPrefix, GetConfig().StateLogPrefix, GetConfig().StateLogPrefix, GetConfig().ManagementTablePrefix, GetConfig().StateLogPrefix, g_module)
164164
logger.GetLogger().Log(logger.Info, "Loading query bind blocker meta-sql "+q)
165165
stmt, err := conn.PrepareContext(ctx, q)
166166
if err != nil {

lib/racmaint.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ func racMaintMain(shard int, interval int, cmdLineModuleName string) {
9595
tempKey.module = ""
9696
prev[tempKey] = racRow
9797
}
98-
racSQL := fmt.Sprintf("/*shard=%d*/ SELECT inst_id, UPPER(status), status_time, UPPER(module) "+
98+
racSQL := fmt.Sprintf("/*heraMgmt.racMaintShard=%d*/ SELECT inst_id, UPPER(status), status_time, UPPER(module) "+
9999
"FROM %s_maint "+
100100
"WHERE UPPER(machine) = ? and "+
101101
"UPPER(module) in ( ?, ? ) "+ //IN ( UPPER(sys_context('USERENV', 'MODULE')), UPPER(sys_context('USERENV', 'MODULE') || '_TAF' ) ) "+

lib/shardingcfg.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ func GetWLCfg() *WLCfg {
7676
func getSQL() string {
7777
// TODO: add hostname in the comment
7878
if len(GetConfig().ShardingPostfix) != 0 {
79-
return fmt.Sprintf("SELECT scuttle_id, shard_id, read_status, write_status from %s_shard_map_%s where status = 'Y'", GetConfig().ManagementTablePrefix, GetConfig().ShardingPostfix)
79+
return fmt.Sprintf("SELECT /*heraMgmt.Sharding*/ scuttle_id, shard_id, read_status, write_status from %s_shard_map_%s where status = 'Y'", GetConfig().ManagementTablePrefix, GetConfig().ShardingPostfix)
8080
}
8181
//TODO: is this still needed?
8282
slowf := fmt.Sprintf("slow.%d", os.Getpid())
@@ -86,15 +86,15 @@ func getSQL() string {
8686
n, err := f.Read(buf[:63])
8787
if err == nil {
8888
buf[n] = 0
89-
sql := fmt.Sprintf("SELECT scuttle_id + usleep(%s) - %s, shard_id, read_status, write_status from %s_shard_map where status = 'Y'", string(buf), string(buf), GetConfig().ManagementTablePrefix)
89+
sql := fmt.Sprintf("SELECT /*heraMgmt.Sharding*/ scuttle_id + usleep(%s) - %s, shard_id, read_status, write_status from %s_shard_map where status = 'Y'", string(buf), string(buf), GetConfig().ManagementTablePrefix)
9090
if logger.GetLogger().V(logger.Warning) {
9191
logger.GetLogger().Log(logger.Warning, "slow shard map query ", sql)
9292
}
9393
return sql
9494
}
9595
}
9696
// if we get here, it means it can't get the slow query
97-
return fmt.Sprintf("SELECT scuttle_id, shard_id, read_status, write_status from %s_shard_map where status = 'Y'", GetConfig().ManagementTablePrefix)
97+
return fmt.Sprintf("SELECT /*heraMgmt.Sharding*/ scuttle_id, shard_id, read_status, write_status from %s_shard_map where status = 'Y'", GetConfig().ManagementTablePrefix)
9898
}
9999

100100
/*

0 commit comments

Comments
 (0)