Closed nvol closed 2 years ago
@nvol Currently the server will indeed create the file if empty, but since the server state is considered empty, it assumes that it is a new start and will not proceed with recovery. Recovering without a server.dat, but existing clients/subscriptions inside the channel is, I believe, bad. The server.dat contains internal subjects that client send the protocols to, etc..
If I make the server check presence of other files when server.dat was not found and in that case fail the startup all-together, then I am afraid the server will never be able to restart - unless the user deletes the whole datastore directory.
I really am not sure what is the best course of action here, but wonder how you got in a situation where server.dat is missing but rest of store is present.
i got into this situation accidently setting up experiments...
why can't we just initialize the server with creating server.dat and then go to the standard process of preparing the server for regular launch with the recovery and so on?
noticed that if server.dat file (in data/ dir) is absent, the server doesn't attempt to recover its state
can see messages in logs:
STREAM: Recovering the state...
STREAM: No recovered state
but, no matter what, server.dat file is being created and on the next server relaunch the recovery process starts as expected