AddHosts is called in the policy before useSystemSchema is set.
if v, ok := s.policy.(bulkAddHosts); ok {
v.AddHosts(hosts)
}
So, getKeyspaceMetadata called by updateReplicas during AddHosts will take useSystemSchema=false and so 2nd query system.schema_keyspaces is called instead of system_schema.keyspaces.
During
NewSession
followed byinit
,AddHosts
is called in the policy beforeuseSystemSchema
is set.So,
getKeyspaceMetadata
called byupdateReplicas
duringAddHosts
will takeuseSystemSchema=false
and so 2nd querysystem.schema_keyspaces
is called instead ofsystem_schema.keyspaces
.so was getting following issue