> After realizing that I came up with another approach, which relies only
> on the presence/absence of the read-only.txt file to figure out the mode
> we're on. On this approach, config.database.main_master/slave are gone
> and we use dbconfig.main_master/slave instead, which are properties in
> DatabaseConfig that return the appropriate value according to the mode
> we're on.
Does this mean we're checking for the presence of this text file before
every database operation? That sounds quite IO intensive.
ISTM that the presence of the file would be checked only a couple times
(once for each of the properties in DatabaseConfig that look for that
file) for each handler thread, as a consequence of storm creating the DB
connections when they're first used.
If that's correct, then we'll have to find a way to reset the stores in
all threads when we switch modes -- something I didn't realize before.