git-hulk commented on code in PR #2527:
URL: https://github.com/apache/kvrocks/pull/2527#discussion_r1749178171
##########
src/cluster/replication.cc:
##########
@@ -732,6 +732,13 @@ ReplicationThread::CBState
ReplicationThread::fullSyncReadCB(bufferevent *bev) {
LOG(INFO) << "[replication] Succeeded restoring the backup, fullsync was
finish";
post_fullsync_cb_();
+ // It needs to reload namespaces from DB after the full sync is done,
+ // or namespaces are not visible in the replica.
+ s = srv_->GetNamespace()->LoadAndRewrite();
+ if (!s.IsOK()) {
+ LOG(ERROR) << "[replication] Failed to load and rewrite namespace: "
<< s.Msg();
+ }
+
Review Comment:
No indeed, it should be used for resetting resources corresponding to
`pre_fullsync_cb`. That said, it must be called once if the `pre_fullsync_cb`
was invoked.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]