fix: record transaction outcomes and measured connection events - #42
Open
crazycs520 wants to merge 1 commit into
Open
crazycs520 wants to merge 1 commit into
crazycs520 wants to merge 1 commit into
Conversation
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
提交失败和被捕获的 SQL 错误此前可能漏记为成功,NEW_ORDER 计数也包含主动回滚。本次保留原始 SQLException,在每次执行的 finally 中记录结果,并只将成功提交的 NEW_ORDER 计入 tpmC;失败行及时 flush,保留终止进程前的证据。
新增固定窗口汇总脚本,直接读取同一 JVM 的 result.csv,以完成时间选择窗口,逐事务类型计算 nearest-rank p95,分别统计错误和成功的主动回滚。DELIVERY_BG 独立报告,主事务吞吐不重复计数。
MySQL 可选
measureConnections=true,通过 Connector/J 的实际认证完成回调记录物理连接;按终端线程区分负载连接和后台发现连接,无逐语句采样或额外 SQL。认证失败不计数;认证成功后 JDBC 初始化失败仍计入物理连接。缺失或不完整的连接证据输出reconnects=null和measurement_valid=false,不会填零。默认关闭,事务 SQL 和分布不变。验证
ant clean test dist、ant test dist通过;既有构造器 this-escape 警告仍在。python3 -m unittest discover -s tests -p 'test_*.py'通过,覆盖窗口边界、p95、回滚失败、后台连接排除和缺失/截断证据。git diff --check通过;生成 JAR 不包含测试类或已删除的 CommitException。尚未运行完整 TPC-C 性能验证;性能影响为 unmeasured。运行参数和采集定义见 HOW-TO-RUN.txt。
范围与兼容性
此变更修复客户端测量口径,可用于比较直接 SQL 入口与实例转发入口。它不实现转发,也不修改服务端端口、路由或 Go TiDB。事务 SQL 和 mix 保持原样;变化是提交失败不再漏记、失败不再计入成功吞吐,
measureConnections默认关闭。固定审查基线为
815fdb24b53c523c2883278f3c5d038c6df915ce,PR Head 为8e55e0d5de940540befdffabeef3471d7196cf7c,目标分支为5.0-mysql-support-opt-2.1。运行对照应使用同一客户端 commit/JAR、测量窗口与连接采集配置;旧输出缺少完整连接证据时不能据此宣称零重连。完整部署与 TPC-C 性能验收尚未运行。