Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use string type for node id when use toml format #4886

Open
zyy17 opened this issue Oct 27, 2024 · 0 comments
Open

Use string type for node id when use toml format #4886

zyy17 opened this issue Oct 27, 2024 · 0 comments
Labels
C-enhancement Category Enhancements

Comments

@zyy17
Copy link
Collaborator

zyy17 commented Oct 27, 2024

What type of enhancement is this?

Configuration

What does the enhancement do?

Background

I'm trying to allocate datanode a node id based on the hash of the node name, for example, 14695981039346656037, then I got an out-of-range error, although we did define node id as u64 type:

Error { inner: OutOfRange(Some("u64")) }

After some digging, I found out the reason is that the toml doesn't support u64. Actually, it supports i64 internally(toml-rs/toml#705). Any numbers that are bigger than i64::MAX will fail to parse.

Although u64 type is not a human-readable type for toml, it's helpful when we want to use some complicate node id allocation.

Advices

For the workaround, I think we can use string type for node id in toml format and parse it as u64 type. However, it would be a breaking change.

Implementation challenges

No response

@zyy17 zyy17 added the C-enhancement Category Enhancements label Oct 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-enhancement Category Enhancements
Projects
None yet
Development

No branches or pull requests

1 participant