Skip to content

Commit bb05689

Browse files
higuoxingzhrt123
andauthored
Revert "Add judgement for fault injector. (#288)" (#291)
This reverts commit a9dfe96. Revert "Add an option to control whether compile with fault injector. (#287)" This reverts commit a331fd9. Co-authored-by: Hao Zhang <hzhang2@vmware.com>
1 parent a9dfe96 commit bb05689

7 files changed

Lines changed: 7 additions & 27 deletions

File tree

CMakeLists.txt

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -168,13 +168,6 @@ BuildInfo_Create(${build_info_PATH}
168168
CMAKE_BUILD_TYPE)
169169
# Create build-info end
170170

171-
if(NOT DEFINED ENABLE_FAULT_INJECTOR)
172-
set(ENABLE_FAULT_INJECTOR OFF)
173-
endif()
174-
if(ENABLE_FAULT_INJECTOR)
175-
add_definitions(-DDISKQUOTA_FAULT_INJECTOR)
176-
endif()
177-
178171
# Add installcheck targets
179172
add_subdirectory(tests)
180173
if(NOT DEFINED ENABLE_UPGRADE_TEST)

cmake/Distro.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ if(NOT DISTRO_NAME)
1515
string(REGEX MATCH "CentOS Linux release 7.*" matched7 "${rh_release}")
1616
string(REGEX MATCH "Red Hat Enterprise Linux release 8.*" matched_rhel8 "${rh_release}")
1717
string(REGEX MATCH "CentOS Linux release 8.*" matched_centos8 "${rh_release}")
18-
string(REGEX MATCH "Rocky Linux release 8.*" matched_rocky8 "${rh_release}")
18+
string(REGEX MATCH "Rocky Linux release 8.*" matched_rocky8 "${rh_release}")
1919
if (matched6)
2020
set(DISTRO_NAME rhel6)
2121
elseif(matched7)

diskquota.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -484,9 +484,8 @@ disk_quota_worker_main(Datum main_arg)
484484
while (!got_sigterm)
485485
{
486486
int rc;
487-
#ifdef DISKQUOTA_FAULT_INJECTOR
487+
488488
SIMPLE_FAULT_INJECTOR("diskquota_worker_main");
489-
#endif
490489
if (!diskquota_is_paused())
491490
{
492491
/* Refresh quota model with init mode */

diskquota_utility.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1358,9 +1358,7 @@ relation_file_stat(int segno, void *ctx)
13581358
else
13591359
snprintf(file_path, MAXPGPATH, "%s.%u", stat_ctx->relation_path, segno);
13601360
struct stat fst;
1361-
#ifdef DISKQUOTA_FAULT_INJECTOR
13621361
SIMPLE_FAULT_INJECTOR("diskquota_before_stat_relfilenode");
1363-
#endif
13641362
if (stat(file_path, &fst) < 0)
13651363
{
13661364
if (errno != ENOENT)

gp_activetable.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -142,9 +142,8 @@ static void
142142
active_table_hook_smgrcreate(RelFileNodeBackend rnode)
143143
{
144144
if (prev_file_create_hook) (*prev_file_create_hook)(rnode);
145-
#ifdef DISKQUOTA_FAULT_INJECTOR
145+
146146
SIMPLE_FAULT_INJECTOR("diskquota_after_smgrcreate");
147-
#endif
148147
report_active_table_helper(&rnode);
149148
}
150149

@@ -220,9 +219,7 @@ object_access_hook_QuotaStmt(ObjectAccessType access, Oid classId, Oid objectId,
220219
report_relation_cache_helper(objectId);
221220
break;
222221
case OAT_POST_ALTER:
223-
#ifdef DISKQUOTA_FAULT_INJECTOR
224222
SIMPLE_FAULT_INJECTOR("object_access_post_alter");
225-
#endif
226223
report_altered_reloid(objectId);
227224
break;
228225
default:

quotamodel.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1576,9 +1576,9 @@ check_rejectmap_by_relfilenode(RelFileNode relfilenode)
15761576
bool found;
15771577
RejectMapEntry keyitem;
15781578
GlobalRejectMapEntry *entry;
1579-
#ifdef DISKQUOTA_FAULT_INJECTOR
1579+
15801580
SIMPLE_FAULT_INJECTOR("check_rejectmap_by_relfilenode");
1581-
#endif
1581+
15821582
memset(&keyitem, 0, sizeof(keyitem));
15831583
memcpy(&keyitem.relfilenode, &relfilenode, sizeof(RelFileNode));
15841584

@@ -1683,10 +1683,8 @@ quota_check_common(Oid reloid, RelFileNode *relfilenode)
16831683

16841684
enable_hardlimit = diskquota_hardlimit;
16851685

1686-
#ifdef DISKQUOTA_FAULT_INJECTOR
16871686
#ifdef FAULT_INJECTOR
16881687
if (SIMPLE_FAULT_INJECTOR("enable_check_quota_by_relfilenode") == FaultInjectorTypeSkip) enable_hardlimit = true;
1689-
#endif
16901688
#endif
16911689
if (relfilenode && enable_hardlimit) return check_rejectmap_by_relfilenode(*relfilenode);
16921690

tests/CMakeLists.txt

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,9 @@ add_custom_target(install_test_extension
4040
)
4141

4242
add_custom_target(installcheck)
43+
add_dependencies(isolation2 install_test_extension)
4344
add_dependencies(regress install_test_extension)
44-
45-
if(ENABLE_FAULT_INJECTOR)
46-
add_dependencies(isolation2 install_test_extension)
47-
add_dependencies(installcheck isolation2 regress)
48-
else()
49-
add_dependencies(installcheck regress)
50-
endif()
45+
add_dependencies(installcheck isolation2 regress)
5146

5247
# Example to run test_truncate infinite times
5348
# RegressTarget_Add(regress_config

0 commit comments

Comments
 (0)