Skip to content

Commit f7d3e72

Browse files
committed
Revert incorrect guard change from the previous NetworkRateBackfill fix
nics.network_rate is an unsigned int column, so it cannot store -1; NULL is the established convention for "unlimited" there, exactly matching how the live precedence code (NetworkOrchestrator.allocateNic()) already stores it. Changing the backfill's guard to write -1 caused a real "Data truncation: Out of range value" failure, confirmed via a second real upgrade run. The original rate > 0 check (skip writing on unlimited, leaving NULL) was correct; only the router public-NIC NPE fix from the previous commit was a genuine bug.
1 parent 8800f0c commit f7d3e72

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

engine/schema/src/main/java/com/cloud/upgrade/NetworkRateBackfill.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ private void backfillNicNetworkRates() {
9090
final boolean defaultNic = rs.getBoolean("default_nic");
9191
try {
9292
final Integer rate = computeLegacyNicNetworkRate(networkId, instanceId, defaultNic);
93-
if (rate != null && rate != 0) {
93+
if (rate != null && rate > 0) {
9494
updateNicNetworkRate(nicId, rate);
9595
}
9696
} catch (Exception e) {

0 commit comments

Comments
 (0)