[sqlite] always enable the write daemon

Summary: Since there is no discernible downside in using the write daemon unless in single-thread mode or in buck, make it only depend on these circumstances, not a command line flag.

Reviewed By: skcho

Differential Revision: D23004451

fbshipit-source-id: 5c1d06ed1
master
Nikos Gorogiannis 4 years ago committed by Facebook GitHub Bot
parent 1e9f5f1bd3
commit e606b0e4fe

@ -1840,10 +1840,6 @@ INTERNAL OPTIONS
--sqlite-vfs-reset
Cancel the effect of --sqlite-vfs.
--sqlite-write-daemon
Activates: Route all DB writes through a daemon process
(Conversely: --no-sqlite-write-daemon)
--starvation-skip-analysis json
Specify combinations of class/method list that should be skipped
during starvation analysis

@ -55,10 +55,7 @@ let add source_file cfg tenv integer_type_widths =
(* NOTE: it's important to write attribute files to disk before writing cfgs to disk.
OndemandCapture module relies on it - it uses existance of the cfg as a barrier to make
sure that all attributes were written to disk (but not necessarily flushed) *)
if Config.sqlite_write_daemon then Cfg.store source_file cfg
else
SqliteUtils.with_transaction (ResultsDatabase.get_database ()) ~f:(fun () ->
Cfg.store source_file cfg ) ;
Cfg.store source_file cfg ;
DBWriter.add_source_file
~source_file:(SourceFile.SQLite.serialize source_file)
~tenv:(Tenv.SQLite.serialize tenv)

@ -2228,9 +2228,9 @@ and sqlite_vfs =
CLOpt.mk_string_opt ?default ~long:"sqlite-vfs" "VFS for SQLite"
and sqlite_write_daemon =
CLOpt.mk_bool ~default:false "Route all DB writes through a daemon process"
~long:"sqlite-write-daemon"
and (_ : bool ref) =
CLOpt.mk_bool ~default:false "[DEPRECATED][DOES NOTHING] option does not exist any more"
~deprecated:["-sqlite-write-daemon"] ~deprecated_no:["-no-sqlite-write-daemon"] ~long:""
and subtype_multirange =
@ -3144,8 +3144,6 @@ and sqlite_lock_timeout = !sqlite_lock_timeout
and sqlite_vfs = !sqlite_vfs
and sqlite_write_daemon = !sqlite_write_daemon
and starvation_skip_analysis = !starvation_skip_analysis
and starvation_strict_mode = !starvation_strict_mode

@ -567,8 +567,6 @@ val sqlite_lock_timeout : int
val sqlite_vfs : string option
val sqlite_write_daemon : bool
val starvation_skip_analysis : Yojson.Basic.t
val starvation_strict_mode : bool

@ -325,7 +325,7 @@ module Server = struct
send Command.Handshake
end
let use_daemon = Config.(sqlite_write_daemon && (not (buck || genrule_mode)) && jobs > 1)
let use_daemon = Config.((not (buck || genrule_mode)) && jobs > 1)
let perform cmd = if use_daemon then Server.send cmd else Command.execute cmd

@ -89,12 +89,6 @@ let db_close db =
(Sqlite3.errmsg db)))
let with_transaction db ~f =
exec db ~log:"begin transaction" ~stmt:"BEGIN IMMEDIATE TRANSACTION" ;
f () ;
exec db ~log:"commit transaction" ~stmt:"COMMIT"
module type Data = sig
type t

@ -60,9 +60,6 @@ val result_unit : ?finalize:bool -> Sqlite3.db -> log:string -> Sqlite3.stmt ->
val db_close : Sqlite3.db -> unit
(** Close the given database and asserts that it was effective. Raises {!Error} if not. *)
val with_transaction : Sqlite3.db -> f:(unit -> unit) -> unit
(** Execute [f] within an explicit sqlite transaction. *)
(** An API commonly needed to store and retrieve objects from the database *)
module type Data = sig
type t

Loading…
Cancel
Save