forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit9eecea7
committed
Don't use Asserts to check for violations of replication protocol.
Using an Assert to check the validity of incoming messages is anextremely poor decision. In a debug build, it should not be that easyfor a broken or malicious remote client to crash the logrep worker.The consequences could be even worse in non-debug builds, which willfail to make such checks at all, leading to who-knows-what misbehavior.Hence, promote every Assert that could possibly be triggered by wrongor out-of-order replication messages to a full test-and-ereport.To avoid bloating the set of messages the translation team has to copewith, establish a policy that replication protocol violation errorreports don't need to be translated. Hence, all the new messages hereuse errmsg_internal(). A couple of old messages are changed likewisefor consistency.Along the way, fix some non-idiomatic or outright wrong uses ofhash_search().Most of these mistakes are new with the "streaming replication"patch (commit4648243), but a couple go back a long way.Back-patch as appropriate.Discussion:https://postgr.es/m/1719083.1623351052@sss.pgh.pa.us1 parent8b9e127 commit9eecea7
2 files changed
+9
-2
lines changedLines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1323 | 1323 |
| |
1324 | 1324 |
| |
1325 | 1325 |
| |
1326 |
| - | |
| 1326 | + | |
1327 | 1327 |
| |
1328 | 1328 |
| |
1329 | 1329 |
| |
|
Lines changed: 8 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
520 | 520 |
| |
521 | 521 |
| |
522 | 522 |
| |
523 |
| - | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
524 | 531 |
| |
525 | 532 |
| |
526 | 533 |
| |
|
0 commit comments
Comments
(0)