当前位置:首页 > 报告详情

测试PostgreSQL代码的故障注入(24页).pdf

上传人: 云闲 编号:87304 2021-01-01 24页 1.26MB

1、Fault injection to test PostgreSQL codeAsim R P apraveenpivotal.io Pune,IndiaAgenda What is lacking in current testing frameworks?What is fault injection?Proposal to inject faults Tests to demonstrate proposed faultinjector patchTesting frameworks in PostgreSQL pg_regress(src/test/regress)A test is

2、written as a.sql file Expected output is saved as an answer file(.out)pg_regress runs a.sql file,compares the output with the answer isolation(src/test/isolation)tests concurrent transactions .spec file-SQL commands within each transaction and how to interleave themisolation:test that select waits f

3、or altersession“s1”setup BEGIN ISOLATION LEVEL READ COMMITTED;step“alter1”ALTER TABLE test ADD RENAME TO test2;step“commit1”COMMIT;session“s2”setup SET default_transaction_isolation=read committed;step“select2”SELECT*from test;permutation“alter1”“s2”“commit1”Testing frameworks in PostgreSQL TAP-test

4、s written in perl(Test:More)Orchestrate a cluster-master and one or more standby initdb,start/stop cluster,etc.src/test/perl/README src/test/modules(not run in CI)modular testing of a specific component,e.g.planner src/test/modules/READMEWhat is lacking in PostgreSQL tests?Test that a backend is kil

5、led after writing commit record but before updating the transaction status in pg_clog Is synchronous replication really synchronous?Was a cached plan reused?Anything comes to your mind?Fault injection Unconference discussion at PGcon 2019 in Ottawa Already being used in Greenplum Patch proposed on p

6、gsql-hackers:https:/www.postgresql.org/message-id/flat/CANXE4TdxdESX1jKw48xet-5GvBFVSq%3D4cgNeioTQff372KO45A%Fault point(./configure CPPFLAGS=-DFAULT_INJECTOR)Fault point-macro definitionSet a fault using its name CREATE EXTENSION faultinjector;Enable the“heap_insert”fault when a tuple is inserted i

word格式文档无特别注明外均可编辑修改,预览文件经过压缩,下载原文更清晰!
三个皮匠报告文库所有资源均是客户上传分享,仅供网友学习交流,未经上传用户书面授权,请勿作商用。
本文主要探讨了PostgreSQL测试框架的不足之处,并提出了一个名为faultinjector的补丁,以实现故障注入测试。当前测试框架存在的问题包括:无法测试后台进程在写入提交记录后但在更新事务状态之前被杀死的场景;同步复制是否真正同步;缓存计划是否被重复使用等。faultinjector补丁可以在特定的点注入故障,以测试数据库在不同压力下的行为。例如,可以通过注入故障来模拟并发事务中的冲突情况,或者测试主服务器在同步复制过程中对备用服务器故障的响应。补丁提供了精细的控制方式,可以指定故障触发的次数和等待时间,并支持远程注入。通过这些功能,开发人员可以更全面地测试数据库的可靠性和稳定性。
"PostgreSQL测试框架的不足是什么?" "故障注入技术在Greenplum中如何应用?" "如何在PostgreSQL中使用故障注入器进行测试?"
客服
商务合作
小程序
服务号
折叠