-
Notifications
You must be signed in to change notification settings - Fork 403
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Bug description
Typical code for updating functions on application initialization looks like this:
box.schema.func.drop("cfn.pm_strftime", { if_exists = true })
box.schema.func.create("cfn.pm_strftime", {
language = "C",
param_list = { "unsigned", "string" },
returns = "string",
exports = { "LUA", "SQL" },
is_deterministic = true
})
box.schema.role.grant("public", "execute", "function", "cfn.pm_strftime")
box.schema.func.drop("cfn.pm_strptime", { if_exists = true })
box.schema.func.create("cfn.pm_strptime", {
language = "C",
param_list = { "string", "string" },
returns = "unsigned",
exports = { "LUA", "SQL" },
is_deterministic = true
})
box.schema.role.grant("public", "execute", "function", "cfn.pm_strptime")
box.schema.func.drop("cfn.pm_timepart", { if_exists = true })
box.schema.func.create("cfn.pm_timepart", {
language = "C",
param_list = { "unsigned", "unsigned" },
returns = "unsigned",
exports = { "LUA", "SQL" },
is_deterministic = true
})
box.schema.role.grant("public", "execute", "function", "cfn.pm_timepart")
This code increases functions IDs by three on every restart of the app. If there are a lot of functions we have a bigger delta. The maximum ID is hardcoded to 32000. If we restart the app regularly by schedule we'll have an overflow soon.
IDs must be the same after drop/create or at least mustn't grow monotonously.
A possible solution is to reuse gaps for ID values. Two other solutions are mentioned here: #11849
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working