Commit 8a3c8ae
committed
Address review feedback on the weighted allocation algorithm
vm_instance.update_time is a TIMESTAMP column, so there is no date that
reliably means "never" - anything past 2038 is out of range. Counting
with no cut-off used Long.MAX_VALUE, which is roughly year 292 million.
The query now leaves the timestamp out entirely in that case rather than
binding an impossible one.
Also catch Exception rather than Throwable in the new query, and put the
config key array one entry per line.
Signed-off-by: Brad House <bhouse@nexthop.ai>1 parent 6a02514 commit 8a3c8ae
2 files changed
Lines changed: 23 additions & 9 deletions
File tree
- engine/schema/src/main/java/com/cloud/vm/dao
- server/src/main/java/com/cloud/agent/manager/allocator/impl
Lines changed: 9 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
155 | 155 | | |
156 | 156 | | |
157 | 157 | | |
158 | | - | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
159 | 162 | | |
160 | 163 | | |
161 | 164 | | |
| |||
807 | 810 | | |
808 | 811 | | |
809 | 812 | | |
810 | | - | |
| 813 | + | |
811 | 814 | | |
812 | 815 | | |
813 | 816 | | |
| |||
818 | 821 | | |
819 | 822 | | |
820 | 823 | | |
821 | | - | |
822 | | - | |
823 | | - | |
| 824 | + | |
| 825 | + | |
| 826 | + | |
824 | 827 | | |
825 | 828 | | |
826 | 829 | | |
| |||
835 | 838 | | |
836 | 839 | | |
837 | 840 | | |
838 | | - | |
| 841 | + | |
839 | 842 | | |
840 | 843 | | |
841 | 844 | | |
| |||
Lines changed: 14 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
400 | 400 | | |
401 | 401 | | |
402 | 402 | | |
403 | | - | |
404 | | - | |
405 | | - | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
406 | 417 | | |
407 | 418 | | |
0 commit comments