Adding more logging to help debug remote replication issues in the future

This commit is contained in:
Jason Fulghum
2024-05-08 10:02:35 -07:00
parent 20de5bedb7
commit 8dabc52b82
2 changed files with 7 additions and 0 deletions
@@ -111,6 +111,8 @@ func (rrd ReadReplicaDatabase) DoltDatabases() []*doltdb.DoltDB {
}
func (rrd ReadReplicaDatabase) PullFromRemote(ctx *sql.Context) error {
ctx.GetLogger().Tracef("pulling from remote %s for database %s", rrd.remote.Name, rrd.Name())
_, headsArg, ok := sql.SystemVariables.GetGlobal(dsess.ReplicateHeads)
if !ok {
return sql.ErrUnknownSystemVariable.New(dsess.ReplicateHeads)
@@ -107,6 +107,11 @@ func newReplicaDatabase(ctx context.Context, name string, remoteName string, dEn
return ReadReplicaDatabase{}, err
}
if sqlCtx, ok := ctx.(*sql.Context); ok {
sqlCtx.GetLogger().Infof(
"replication enabled for database '%s' from remote '%s'", name, remoteName)
}
return rrd, nil
}