kangkaisen commented on a change in pull request #1802: Fix Cluster meta write
error
URL: https://github.com/apache/incubator-doris/pull/1802#discussion_r324136178
##########
File path: fe/src/main/java/org/apache/doris/cluster/Cluster.java
##########
@@ -128,6 +129,7 @@ public void addDb(String name, long id) {
try {
dbNames.add(name);
dbIds.add(id);
+ dbNameToIDs.put(name, id);
Review comment:
I think we needn't.
After Cluster readFields, we will construct a new InfoSchemaDb and add it
to Cluster immediately.
```
public long loadCluster(DataInputStream dis, long checksum) throws
IOException, DdlException {
if (Catalog.getCurrentCatalogJournalVersion() >=
FeMetaVersion.VERSION_30) {
int clusterCount = dis.readInt();
checksum ^= clusterCount;
for (long i = 0; i < clusterCount; ++i) {
final Cluster cluster = Cluster.read(dis);
...
final InfoSchemaDb db = new InfoSchemaDb(cluster.getName());
...
cluster.addDb(db.getFullName(), db.getId());
```
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]