Skip to content

Commit

Permalink
prefix is V02_
Browse files Browse the repository at this point in the history
  • Loading branch information
chronolaw committed Jan 6, 2025
1 parent f189dac commit 7a517d0
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions kong/clustering/services/sync/rpc.lua
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,12 @@ end

local is_invalid_version
do
local byte = string.byte
local CHAR_V = byte("V")
local sub = string.sub
local VER_PREFIX = "V02_"

-- version string must start with char 'V'
-- version string must start with 'V02_'
is_invalid_version = function(v)
return byte(v) ~= CHAR_V
return sub(v, 1, 4) ~= VER_PREFIX
end
end

Expand Down
4 changes: 2 additions & 2 deletions kong/clustering/services/sync/strategies/postgres.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ local ngx_null = ngx.null


-- version string should be greater than any hex string(ngx.md5)
-- e.g.: "V000" > "FFFF"
local VERSION_FMT = "V%031d"
-- e.g.: "V02_0000" > "FFFFFFFF"
local VERSION_FMT = "V02_%028d"


function _M.new(db)
Expand Down
2 changes: 1 addition & 1 deletion spec/02-integration/18-hybrid_rpc/05-sync-rpc_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ local DP_PREFIX = "servroot_dp"

-- now version must be a string
local function fmt(v)
return string.format("V%031d", v)
return string.format("V02_%028d", v)
end


Expand Down

0 comments on commit 7a517d0

Please sign in to comment.