- Notifications
You must be signed in to change notification settings - Fork4.9k
Commit2d77d83
committed
Refactor the syslogger pipe protocol to use a bitmask for its options
The previous protocol expected a set of matching characters to check ifa message sent was the last one or not, that changed depending on thedestination wanted:- 't' and 'f' tracked the last message of a log sent to stderr.- 'T' and 'F' tracked the last message of a log sent to csvlog.This could be extended with more characters when introducing newdestinations, but using a bitmask is much more elegant. This commitchanges the protocol so as a bitmask is used in the header of a logchunk message sent to the syslogger, with the following optionsavailable for now:- log_destination as stderr.- log_destination as csvlog.- if a message is the last chunk of a message.Sehrope found this issue in a patch set to introduce JSON as an optionfor log_destination, but his patch made the size of the protocol headerlarger. This commit keeps the same size as the original, and adapts theprotocol as wanted.Thanks also to Andrew Dunstan and Greg Stark for the discussion.Author: Michael Paquier, Sehrope SarkuniDiscussion:https://postgr.es/m/CAH7T-aqswBM6JWe4pDehi1uOiufqe06DJWaU5=X7dDLyqUExHg@mail.gmail.com1 parente757080 commit2d77d83
File tree
3 files changed
+27
-9
lines changed- src
- backend
- postmaster
- utils/error
- include/postmaster
3 files changed
+27
-9
lines changedLines changed: 14 additions & 5 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
38 | 38 |
| |
39 | 39 |
| |
40 | 40 |
| |
| 41 | + | |
41 | 42 |
| |
42 | 43 |
| |
43 | 44 |
| |
| |||
885 | 886 |
| |
886 | 887 |
| |
887 | 888 |
| |
| 889 | + | |
888 | 890 |
| |
889 | 891 |
| |
890 | 892 |
| |
| 893 | + | |
891 | 894 |
| |
892 | 895 |
| |
893 | 896 |
| |
894 |
| - | |
895 |
| - | |
| 897 | + | |
896 | 898 |
| |
897 | 899 |
| |
898 | 900 |
| |
| |||
906 | 908 |
| |
907 | 909 |
| |
908 | 910 |
| |
909 |
| - | |
910 |
| - | |
| 911 | + | |
| 912 | + | |
| 913 | + | |
| 914 | + | |
| 915 | + | |
| 916 | + | |
| 917 | + | |
| 918 | + | |
| 919 | + | |
911 | 920 |
| |
912 | 921 |
| |
913 | 922 |
| |
| |||
924 | 933 |
| |
925 | 934 |
| |
926 | 935 |
| |
927 |
| - | |
| 936 | + | |
928 | 937 |
| |
929 | 938 |
| |
930 | 939 |
| |
|
Lines changed: 7 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
3250 | 3250 |
| |
3251 | 3251 |
| |
3252 | 3252 |
| |
| 3253 | + | |
| 3254 | + | |
| 3255 | + | |
| 3256 | + | |
| 3257 | + | |
3253 | 3258 |
| |
3254 | 3259 |
| |
3255 | 3260 |
| |
3256 | 3261 |
| |
3257 |
| - | |
| 3262 | + | |
3258 | 3263 |
| |
3259 | 3264 |
| |
3260 | 3265 |
| |
| |||
3264 | 3269 |
| |
3265 | 3270 |
| |
3266 | 3271 |
| |
3267 |
| - | |
| 3272 | + | |
3268 | 3273 |
| |
3269 | 3274 |
| |
3270 | 3275 |
| |
|
Lines changed: 6 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
46 | 46 |
| |
47 | 47 |
| |
48 | 48 |
| |
49 |
| - | |
50 |
| - | |
| 49 | + | |
51 | 50 |
| |
52 | 51 |
| |
53 | 52 |
| |
| |||
60 | 59 |
| |
61 | 60 |
| |
62 | 61 |
| |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
63 | 67 |
| |
64 | 68 |
| |
65 | 69 |
| |
|
0 commit comments
Comments
(0)