Skip to content

Commit

Permalink
Fix bug that premature updating schema hash of replica when reporting (
Browse files Browse the repository at this point in the history
…#1084)

The new schema hash should only be updated when schema changing finished.
  • Loading branch information
morningman authored and imay committed May 1, 2019
1 parent 6cc0457 commit e373aa5
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

package org.apache.doris.catalog;

import org.apache.doris.catalog.Replica.ReplicaState;
import org.apache.doris.thrift.TPartitionVersionInfo;
import org.apache.doris.thrift.TStorageMedium;
import org.apache.doris.thrift.TTablet;
Expand Down Expand Up @@ -141,8 +142,9 @@ public void tabletReport(long backendId, Map<Long, TTablet> backendTablets,
replica.setPathHash(backendTabletInfo.getPath_hash());
}

if (backendTabletInfo.isSetSchema_hash()
if (backendTabletInfo.isSetSchema_hash() && replica.getState() == ReplicaState.NORMAL
&& replica.getSchemaHash() != backendTabletInfo.getSchema_hash()) {
// update the schema hash only when replica is normal
replica.setSchemaHash(backendTabletInfo.getSchema_hash());
}

Expand Down

0 comments on commit e373aa5

Please sign in to comment.