forked from apache/doris
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[enhancement](regression) fault injection for segcompaction test (apa…
…che#25709) 1. generalized debug point facilities from docker suites for fault-injection/stubbing cases 2. add segcompaction fault-injection cases for demonstration 3. add -238 TOO_MANY_SEGMENTS fault-injection case for good
- Loading branch information
1 parent
93d50a2
commit 808d74a
Showing
13 changed files
with
458 additions
and
43 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
7 changes: 7 additions & 0 deletions
7
...on-test/data/fault_injection_p0/fault_injection_p0/test_segcompaction_fault_injection.out
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
-- This file is automatically generated. You should know what you did if you want to edit this | ||
-- !select_default -- | ||
|
||
-- !select_default -- | ||
|
||
-- !select_default -- | ||
|
3 changes: 3 additions & 0 deletions
3
...est/data/fault_injection_p0/fault_injection_p0/test_too_many_segments_fault_injection.out
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
-- This file is automatically generated. You should know what you did if you want to edit this | ||
-- !select_default -- | ||
|
3 changes: 3 additions & 0 deletions
3
regression-test/data/segcompaction_p2/test_segcompaction_fault_injection.out
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
-- This file is automatically generated. You should know what you did if you want to edit this | ||
-- !select_default -- | ||
|
This file contains 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
This file contains 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
139 changes: 139 additions & 0 deletions
139
regression-test/framework/src/main/groovy/org/apache/doris/regression/util/DebugPoint.groovy
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,139 @@ | ||
// Licensed to the Apache Software Foundation (ASF) under one | ||
// or more contributor license agreements. See the NOTICE file | ||
// distributed with this work for additional information | ||
// regarding copyright ownership. The ASF licenses this file | ||
// to you under the Apache License, Version 2.0 (the | ||
// "License"); you may not use this file except in compliance | ||
// with the License. You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, | ||
// software distributed under the License is distributed on an | ||
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
// KIND, either express or implied. See the License for the | ||
// specific language governing permissions and limitations | ||
// under the License. | ||
package org.apache.doris.regression.util | ||
import org.apache.doris.regression.util.Http | ||
import org.codehaus.groovy.runtime.IOGroovyMethods | ||
import org.apache.doris.regression.suite.Suite | ||
|
||
enum NodeType { | ||
FE, | ||
BE, | ||
} | ||
|
||
class DebugPoint { | ||
Suite suite | ||
|
||
DebugPoint(Suite suite) { | ||
this.suite = suite | ||
} | ||
|
||
/* Enable debug point in regression | ||
* Note: set BE config::enable_debug_points = true to take effect | ||
* Parameters: | ||
* host: hostname or ip of target node | ||
* httpPort: http port of target node | ||
* type: NodeType.BE or NodeType.FE | ||
* name: debug point name | ||
* params: timeout, execute, or other customized input params | ||
*/ | ||
static def enableDebugPoint(String host, String httpPort, NodeType type, String name, Map<String, String> params = null) { | ||
def url = 'http://' + host + ':' + httpPort + '/api/debug_point/add/' + name | ||
if (params != null && params.size() > 0) { | ||
url += '?' + params.collect((k, v) -> k + '=' + v).join('&') | ||
} | ||
def result = Http.http_post(url, null, true) | ||
checkHttpResult(result, type) | ||
} | ||
|
||
/* Disable debug point in regression | ||
* Parameters: | ||
* host: hostname or ip of target node | ||
* httpPort: http port of target node | ||
* type: NodeType.BE or NodeType.FE | ||
* name: debug point name | ||
*/ | ||
static def disableDebugPoint(String host, String httpPort, NodeType type, String name) { | ||
def url = 'http://' + host + ':' + httpPort + '/api/debug_point/remove/' + name | ||
def result = Http.http_post(url, null, true) | ||
checkHttpResult(result, type) | ||
} | ||
|
||
/* Disable all debug points in regression | ||
* Parameters: | ||
* host: hostname or ip of target node | ||
* httpPort: http port of target node | ||
* type: NodeType.BE or NodeType.FE | ||
*/ | ||
static def clearDebugPoints(String host, String httpPort, NodeType type) { | ||
def url = 'http://' + host + ':' + httpPort + '/api/debug_point/clear' | ||
def result = Http.http_post(url, null, true) | ||
checkHttpResult(result, type) | ||
} | ||
|
||
def operateDebugPointForAllBEs(Closure closure) { | ||
def ipList = [:] | ||
def portList = [:] | ||
(ipList, portList) = getBEHostAndHTTPPort() | ||
ipList.each { beid, ip -> | ||
closure.call(ip, portList[beid]) | ||
} | ||
} | ||
|
||
/* Enable specific debug point for all BE node in cluster */ | ||
def enableDebugPointForAllBEs(String name, Map<String, String> params = null) { | ||
operateDebugPointForAllBEs({ host, port -> | ||
println "enable debug point $name for BE $host:$port" | ||
enableDebugPoint(host, port, NodeType.BE, name, params) | ||
}) | ||
} | ||
|
||
/* Disable specific debug point for all BE node in cluster */ | ||
def disableDebugPointForAllBEs(String name) { | ||
operateDebugPointForAllBEs { host, port -> | ||
disableDebugPoint(host, port, NodeType.BE, name) | ||
} | ||
} | ||
|
||
/* Disable all debug points for all BE node in cluster */ | ||
def clearDebugPointsForAllBEs() { | ||
operateDebugPointForAllBEs { host, port -> | ||
clearDebugPoints(host, port, NodeType.BE) | ||
} | ||
} | ||
|
||
def getBEHostAndHTTPPort() { | ||
def ipList = [:] | ||
def portList = [:] | ||
suite.getBackendIpHttpPort(ipList, portList) | ||
return [ipList, portList] | ||
} | ||
|
||
def getFEHostAndHTTPPort() { | ||
assert false : 'not implemented yet' | ||
} | ||
|
||
def enableDebugPointForAllFEs(String name, Map<String, String> params = null) { | ||
assert false : 'not implemented yet' | ||
} | ||
|
||
def disableDebugPointForAllFEs(String name) { | ||
assert false : 'not implemented yet' | ||
} | ||
|
||
def clearDebugPointsForAllFEs() { | ||
assert false : 'not implemented yet' | ||
} | ||
|
||
static void checkHttpResult(Object result, NodeType type) { | ||
if (type == NodeType.FE) { | ||
assert result.code == 0 : result.toString() | ||
} else if (type == NodeType.BE) { | ||
assert result.status == 'OK' : result.toString() | ||
} | ||
} | ||
} | ||
|
Oops, something went wrong.