Skip to content

Allow to configure key-sorting natural/hierarchical on namespaces#818

Merged
mattisonchao merged 6 commits intooxia-db:mainfrom
merlimat:sorting-conf
Nov 22, 2025
Merged

Allow to configure key-sorting natural/hierarchical on namespaces#818
mattisonchao merged 6 commits intooxia-db:mainfrom
merlimat:sorting-conf

Conversation

@merlimat
Copy link
Copy Markdown
Collaborator

Added ability to select key sorting on namespaces.

By default, we will continue to use the "hierarchical" sorting. At some point, the default might get switched.

Signed-off-by: Matteo Merli <mmerli@apache.org>
merlimat and others added 4 commits November 21, 2025 16:45
Signed-off-by: Matteo Merli <mmerli@apache.org>
Signed-off-by: Matteo Merli <mmerli@apache.org>
Signed-off-by: Matteo Merli <mmerli@apache.org>
&proto.NewTermOptions{EnableNotifications: enableNotification.Get()},
&proto.NewTermOptions{
EnableNotifications: enableNotification.Get(),
KeySorting: nsConfig.KeySorting.ToProto(),
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Potential NPE here.

InitialShardCount uint32 `json:"initialShardCount" yaml:"initialShardCount"`
ReplicationFactor uint32 `json:"replicationFactor" yaml:"replicationFactor"`
NotificationsEnabled entity.OptBooleanDefaultTrue `json:"notificationsEnabled" yaml:"notificationsEnabled"`
KeySorting KeySorting `json:"keySorting" yaml:"keySorting"`
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It's better to add json:"keySorting" yaml:"keySorting,omitempty".

}
}

func KeySortingFromProto(s proto.KeySortingType) KeySorting {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Hmm... it seems this method is mainly used for testing. In my opinion, we should use plain text for testing to simulate real-world usage.

@mattisonchao mattisonchao merged commit 669841d into oxia-db:main Nov 22, 2025
5 checks passed
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.

2 participants