Skip to content

Commit

Permalink
feat: Improve VIP calculation
Browse files Browse the repository at this point in the history
Keep the same address for all of the clustered machines
  • Loading branch information
mromulus committed Mar 22, 2024
1 parent c04e965 commit 5a670e1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/models/address.rb
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ def ip_object(sequence_number: nil, sequence_total: nil, actor_number: nil)
return unless fixed? && ip_family_network_template.present?
static_offset = offset.to_i
static_offset -= 1 if ipv6?
static_offset += (sequence_number || 1) - 1
static_offset += (sequence_number || 1) - 1 unless vip?
static_offset += ((actor_number || 1) - 1) * (sequence_total || 1) if !address_pool&.numbered?

ip_family_network(actor_number).allocate(static_offset)
Expand Down

0 comments on commit 5a670e1

Please sign in to comment.