Skip to content

Chaos test stand#28

Merged
Pavkazzz merged 7 commits intoaiokitchen:masterfrom
Pavkazzz:chaos-test-stand
Apr 13, 2026
Merged

Chaos test stand#28
Pavkazzz merged 7 commits intoaiokitchen:masterfrom
Pavkazzz:chaos-test-stand

Conversation

@Pavkazzz
Copy link
Copy Markdown
Collaborator

@Pavkazzz Pavkazzz commented Mar 30, 2026

Chaos Test Results

Tested against Docker cluster: 3 PostgreSQL 16 nodes (1 master + 2 replicas),
streaming replication, iptables-based network fault injection.

hasql 0.8.0 (master)

freeze_master -- iptables DROP on master, promote replica, unfreeze

Driver                Writes OK  Write Err   Reads OK   Read Err   Max W ms   Max R ms
---------------------------------------------------------------------------------------
asyncpg                      49          0         49          0      26835          1
aiopg                        50          0         50          0      26450          1
psycopg3                     49          0         49          0      26366          2
aiopg_sa                     50          0         50          0      26364          1
asyncsqlalchemy              49          0         49          0      26720         25

replica_failover -- kill both replicas, restart sequentially

Driver                Writes OK  Write Err   Reads OK   Read Err   Max W ms   Max R ms
---------------------------------------------------------------------------------------
asyncpg                      35          0         34          1          1         23
aiopg                        36          0         36          0          2          1
psycopg3                     36          0         36          0          3          2
aiopg_sa                     36          0         36          0          3          1
asyncsqlalchemy              36          0         35          1         23         25

hasql 0.10.0 (feature/types-and-split)

freeze_master

Driver                Writes OK  Write Err   Reads OK   Read Err   Max W ms   Max R ms
---------------------------------------------------------------------------------------
asyncpg                      49          0         49          0      26684          1
aiopg                        49          0         49          0      26798          1
psycopg3                     49          0         49          0      26743          2
aiopg_sa                     50          0         50          0      26724          1
asyncsqlalchemy              50          0         50          0      26579         25

replica_failover

Driver                Writes OK  Write Err   Reads OK   Read Err   Max W ms   Max R ms
---------------------------------------------------------------------------------------
asyncpg                      35          0         34          1          2         21
aiopg                        36          0         36          0          3          1
psycopg3                     36          0         36          0          3          1
aiopg_sa                     36          0         35          1          2          1
asyncsqlalchemy              36          0         35          1         22         24

Summary

  • Zero write errors across all drivers in both versions and both scenarios
  • freeze_master: all drivers survive master failover with ~26s blocked write (TCP timeout), reads uninterrupted
  • replica_failover: asyncpg-based drivers (asyncpg, asyncsqlalchemy) show 1 transient read error on abrupt replica kill; aiopg and psycopg3 handle it cleanly
  • No regressions in 0.10.0 -- behavior is identical to 0.8.0
  • Unit tests: 140 passed (0.8.0), 277 passed (0.10.0)

Pavkazzz and others added 7 commits March 30, 2026 01:31
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@Pavkazzz Pavkazzz merged commit c4714aa into aiokitchen:master Apr 13, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant