News for hackers. Stuff that matters.
Re:uWebSockets by detaro on Wednesday October 26, 2022 @12:38PM (#33346177)
migrating an open socket to me sounds like it'd be more hassle than it's worth. It's possible to do, but unusual.

Can't you not involve the client and send it an explicit "reconnect to server XYZ" message, only move clients that really need to move?

Re:uWebSockets by cphoover on Wednesday October 26, 2022 @01:09PM (#33346578)
Yes... but this seems to be then a timing issue to me... what happens if the replication factor changes again while they are reconnecting to the wrong server... then they will miss the second 'reconnect' message... and will stay connected to this server where it will never receive messages... perhaps an edge-case scenario.
Re:uWebSockets by erichocean on Wednesday October 26, 2022 @07:34PM (#33351057)
I recommend storing the server topology somewhere that's super highly available, like Cloudflare. Then having the client choose from that. If their connection drops (use heartbeats), retry a different one you have and refresh the server topology in parallel. If the second connection fails, retry again with the new topology. This is convergent and avoids putting load on your database to connect, so you don't suffer from thundering herd problems.