When Auto GC is enabled, the running sql-server will periodically
collect a Dolt database that is growing in size. This behavior
is currently experimental. Tuning the behavior around how often to collect is
ongoing work.
This PR changes each RPC invocation against the gRPC and HTTP servers
implementing remotesapi and cluster replication to create a sql.Context
which lives the duration of the call. The Session for that call gets
SessionCommand{Begin,End} and SessionEnd lifecycle callbacks so that it
can participate in GC safepoint rendezvous appropriately.
Previously the remotesrv.DBCache and the user/password remotesapi
authentication implementation would simply create new sql.Contexts
whenever they needed them. There could be multiple sql.Contexts for the
single server call.
* turn on stats collect by default
* better impl of default stats for server only
* [ga-format-pr] Run go/utils/repofmt/format_repo.sh and go/Godeps/update.sh
* fix deadlock
* [ga-format-pr] Run go/utils/repofmt/format_repo.sh and go/Godeps/update.sh
* split off branch delete interface
* fix more tests
* fix more tests
* add test for auto-on
* zach comments
---------
Co-authored-by: max-hoffman <max-hoffman@users.noreply.github.com>
* allow 'show replica status' before replication is started
* move DEBUG logging of binlog messages to TRACE level
* persisting replication running state and automatically restarting
* passing in SQL engine, instead of relying on GetRunningServer global function
PR Feedback: Removing duplicate call to InitPersistedSystemVars
PR Feedback: Renaming writeWorkingSetAndNotifyListeners to writeWorkingSet
PR Feedback: Adding a note to the RegisterReplica method on the primary controller.
PR Feedback: omitting empty fields
PR Feedback: Adding a comment about DoltDB.databaseName only being populated for filesystem-based databases.
PR Feedback: Decreasing the time limit for waitForReplicaToHaveLatestGtid to 10s instead of 60s
PR Feedback: Adding a test that shows rolled back transactions aren't replicated
PR Feedback: Adding a TODO about additional error handling on streaming events to connected replicas
PR Feedback: Added a comment on the limitation of finding the database name from the URL
In the cluster commithook, we had a failure mode where we would leak a
*grpc.ClientConn without closing it. It turns out, if an outbound request has
made on a ClientConn, it will continue retrying the connection. And we would
leak one on a fixed interval, resulting in ever-increasing CPU utilization.