3 ms·
> Is there any indication on the replicas that they are read-only? Right, I get that Litestream can't prevent my application from opening the database RW, but
by GauntletWizard 5y ago
> Is there any indication on the replicas that they are read-only?
Right, I get that Litestream can't prevent my application from opening the database RW, but what I'd like to see is that there's an endpoint on the http server that I can query to tell if it's in "Leader" or "Follower" mode; i.e. will Litestream be reading from the db file, or will it be writing to it? That could be used as a part of implementing a master-election scheme; An elector starts up Litestream in either "RW" or "RO" mode, and the application determines from litestream when it's safe to write. The only reason I'd not trust that to the elector is that I want litestream to finish it's replay first, as above.
> Is it even possible by SQLite semantics, or will I get locking timeouts if I try to write while the process is running?
Would it be possible for the follower Litestream copies to simply hold this lock all of the time, "preventing" (i.e. not through actual exclusion, but existing sqlite semantics) writes?