Commit c9b2ce2
committed
Store -1 directly for unlimited NIC network rate instead of NULL
nics.network_rate was unsigned, so the only way to represent "unlimited"
was NULL, even though every response-building call site already
normalizes null/non-positive to -1 for API output - meaning NULL and -1
were already behaviorally equivalent, just inconsistent at the storage
layer. NetworkModelImpl.getNetworkRate() never actually returns null
(always a positive rate or -1), so the null-coalescing in
NetworkOrchestrator was dead code once the column can hold -1 directly.
Make the column signed so it can store -1 like every other "resolved"
rate value in the codebase, simplify both NetworkOrchestrator call
sites to store the value as-is, and let the backfill persist -1 for
NICs whose legacy rate is unlimited instead of leaving them NULL.1 parent f7d3e72 commit c9b2ce2
3 files changed
Lines changed: 4 additions & 4 deletions
File tree
- engine
- orchestration/src/main/java/org/apache/cloudstack/engine/orchestration
- schema/src/main
- java/com/cloud/upgrade
- resources/META-INF/db
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1233 | 1233 | | |
1234 | 1234 | | |
1235 | 1235 | | |
1236 | | - | |
| 1236 | + | |
1237 | 1237 | | |
1238 | 1238 | | |
1239 | 1239 | | |
| |||
2307 | 2307 | | |
2308 | 2308 | | |
2309 | 2309 | | |
2310 | | - | |
| 2310 | + | |
2311 | 2311 | | |
2312 | 2312 | | |
2313 | 2313 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
90 | 90 | | |
91 | 91 | | |
92 | 92 | | |
93 | | - | |
| 93 | + | |
94 | 94 | | |
95 | 95 | | |
96 | 96 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
| 22 | + | |
23 | 23 | | |
24 | 24 | | |
0 commit comments