programming

7 readers
1 users here now

Computer Programming.

founded 1 year ago
MODERATORS
101
 
 
The original post: /r/programming by /u/primaryobjects on 2024-12-30 17:13:00.
102
 
 
The original post: /r/programming by /u/ChrisPanov on 2024-12-30 16:59:39.
103
 
 
The original post: /r/programming by /u/Bulky_Pomegranate_53 on 2024-12-30 16:57:41.
104
 
 
The original post: /r/programming by /u/DevCuriosity on 2024-12-30 16:53:28.
105
 
 
The original post: /r/programming by /u/lyonwj on 2024-12-30 15:46:13.
106
 
 
The original post: /r/programming by /u/delvin0 on 2024-12-30 10:54:48.
107
 
 
The original post: /r/programming by /u/HaimZlatokrilov on 2024-12-30 15:14:58.
108
 
 
The original post: /r/programming by /u/AmrDeveloper on 2024-12-30 15:14:37.
109
 
 
The original post: /r/programming by /u/Complete_Decision195 on 2024-12-30 15:03:13.

Newbie here and not sure If I'm on the correct page ๐Ÿ™ˆ

I'm planning to get a MacBook mainly for expanding my knowledge on programming (also works as programmer) and for VA (digital work) is it worth it? Any thoughts?

110
 
 
The original post: /r/programming by /u/avinassh on 2024-12-30 14:55:47.
111
 
 
The original post: /r/programming by /u/0xBitBuster on 2024-12-30 13:49:09.
112
 
 
The original post: /r/programming by /u/sgielen on 2024-12-30 13:44:28.

TLDR: Run pglocklogger on your prod databases. Whenever there's an outage due to blocking in PostgreSQL, it may give you essential observability.

Recently, I experienced a prod outage caused by a blocked migration.

The migration itself was almost instantaneous, but it picks up a lock before it actually runs. That may take a while, but that's no problem, right? The migration runs a bit later, no worries.

That's when I learned that an ALTER TABLE waiting on a lock, itself also blocks benign work that would otherwise run concurrently. So having your blocked ALTER TABLE can spiral into an application-wide outage quite easily.

For example, a SELECT WITH UPDATE can run simultaneously with a SELECT, but not if an ALTER TABLE is executed in between. This is to prevent livelocks. A simple solution is to set a lock_timeout in your migrations, which causes the ALTER to fail early and allow all other work to continue. Then, retry the migration later.

I figured this out during the post-mortem analysis, but during the outage, this was hard to infer, even from PostgreSQL's own slow query log. There's a number of resources on how to discover this during an outage, but afterwards, all that information is gone.

Not with pglocklogger. It inspects PostgreSQL's in-memory state (using in-memory tables intended for this) and logs the output when it crosses particular thresholds. In an outage, or during post-mortem investigations, this may turn out to be an essential observability tool.

113
 
 
The original post: /r/programming by /u/derjanni on 2024-12-30 13:43:31.
114
 
 
The original post: /r/programming by /u/ketan_ip on 2024-12-30 13:43:01.
115
 
 
The original post: /r/programming by /u/wilsoniumite on 2024-12-30 12:45:28.
116
 
 
The original post: /r/programming by /u/self on 2024-12-30 12:35:46.
117
 
 
The original post: /r/programming by /u/radekmie on 2024-12-30 10:13:24.
118
 
 
The original post: /r/programming by /u/bitter-cognac on 2024-12-30 09:37:04.
119
 
 
The original post: /r/programming by /u/Fast-Tourist5742 on 2024-12-30 08:22:34.
120
 
 
The original post: /r/programming by /u/chrisza4 on 2024-12-30 07:51:29.
121
 
 
The original post: /r/programming by /u/juvodu on 2024-12-30 07:36:17.
122
 
 
The original post: /r/programming by /u/FoxInTheRedBox on 2024-12-30 06:31:03.
123
 
 
The original post: /r/programming by /u/theowni on 2024-12-30 06:10:40.
124
 
 
The original post: /r/programming by /u/emanuelpeg on 2024-12-30 05:03:22.
125
 
 
The original post: /r/programming by /u/PraisePancakes on 2024-12-30 04:08:47.
view more: โ€น prev next โ€บ