Files
seaweedFS/weed/command
Chris Lu 59a7c40043 Add keyPrefix support for TiKV store (#7756)
* Add keyPrefix support for TiKV store

Similar to the Redis keyPrefix feature (#7299), this adds keyPrefix support
for TiKV stores to enable sharing a single TiKV cluster as metadata store
for multitenant SeaweedFS clusters.

Changes:
- Add keyPrefix field to TikvStore struct
- Update Initialize function to read keyPrefix from config
- Add getKey method to prepend prefix to all keys
- Update generateKey, getNameFromKey, and genDirectoryKeyPrefix methods
  to be store receiver methods and handle key prefixing
- Update filer.toml scaffold with keyPrefix configuration option

Fixes #7752

* Fix potential slice corruption in getKey method

Use a new slice with proper capacity to avoid modifying the
underlying array of store.keyPrefix when appending.

* Add keyPrefix validation and defensive bounds check

- Add validation in Initialize to reject keyPrefix longer than 256 bytes
- Add bounds check in getNameFromKey to prevent panic on malformed keys

* Update weed/filer/tikv/tikv_store.go

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update weed/command/scaffold/filer.toml

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-12-14 23:40:01 -08:00
..
2025-10-27 23:04:55 -07:00
2025-10-13 18:05:17 -07:00
2025-09-09 01:01:03 -07:00
2021-09-01 02:45:42 -07:00
2025-10-13 18:05:17 -07:00
2025-12-14 16:02:06 -08:00
2025-03-29 21:12:06 -07:00
2025-10-31 17:08:00 -07:00
2022-02-27 03:03:19 -08:00
2022-08-31 23:16:05 -07:00
2025-10-13 18:05:17 -07:00
2025-10-13 18:05:17 -07:00
2025-12-14 16:02:06 -08:00
2019-11-28 18:44:27 -08:00
2025-07-02 18:03:17 -07:00
2024-07-16 09:15:55 -07:00
2025-10-13 18:05:17 -07:00
2025-03-29 21:12:06 -07:00
2025-06-03 22:50:45 -07:00
2025-06-26 11:09:17 -07:00
2025-06-03 22:46:10 -07:00