Skip to content

bugfix: load cached UDF names during MetaStore initialization#1050

Merged
yokofly merged 3 commits intodevelopfrom
bugfix/issue-1049-missing-udf-reloading
Dec 10, 2025
Merged

bugfix: load cached UDF names during MetaStore initialization#1050
yokofly merged 3 commits intodevelopfrom
bugfix/issue-1049-missing-udf-reloading

Conversation

@yokofly
Copy link
Copy Markdown
Collaborator

@yokofly yokofly commented Dec 10, 2025

PR checklist:

  • Did you run ClangFormat ?
  • Did you separate headers to a different section in existing community code base ?
  • Did you surround proton: starts/ends for new code in existing community code base ?

Please write user-readable short description of the changes:
fix #1049

@yokofly yokofly self-assigned this Dec 10, 2025
@yokofly yokofly merged commit 3c78d19 into develop Dec 10, 2025
8 of 11 checks passed
@yokofly yokofly deleted the bugfix/issue-1049-missing-udf-reloading branch December 10, 2025 07:55
Copy link
Copy Markdown
Contributor

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines 146 to +150
/// Mark as ready
setReady();

/// Load cached UDF names so UDF lookups work after restart
loadUserDefinedFunctions();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Guard UDF cache loading with mutex

init() now calls loadUserDefinedFunctions() after flipping setReady(), but loadUserDefinedFunctions() inserts into udf_names without taking mutexes.udf_mu while later readers (e.g., listUserDefinedFunctions) hold that shared mutex. With ready set first, other threads unblocked by readiness can read the set under the lock while init() writes without one, leading to a data race/undefined behavior (or transient UNKNOWN_FUNCTION replies) during startup. Protect the load with the same mutex or perform it before setting ready.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

missing reload udf from metastore after reboot

2 participants