special case userroomid_highlightcount

This fixes the panic on startup with a fresh database.
This commit is contained in:
Charles Hall 2024-05-21 17:56:56 -07:00
parent b3709f262e
commit 6e2eec012f
No known key found for this signature in database
GPG key ID: 7B8E0645816E07CF

View file

@ -116,11 +116,15 @@ impl KeyValueDatabaseEngine for Arc<Engine> {
let created_already = !new_cfs.insert(name); let created_already = !new_cfs.insert(name);
assert!( assert!(
!created_already, // userroomid_highlightcount is special-cased because it is an
// existing violation of this check that happens to work anyway. We
// should write a database migration to obviate the need for this.
!(created_already && name != "userroomid_highlightcount"),
"detected attempt to alias column family: {name}", "detected attempt to alias column family: {name}",
); );
if !self.old_cfs.contains(&name.to_owned()) { // Remove `&& !created_already` when the above is addressed
if !self.old_cfs.contains(&name.to_owned()) && !created_already {
// Create if it didn't exist // Create if it didn't exist
self.rocks self.rocks
.create_cf(name, &db_options(self.max_open_files, &self.cache)) .create_cf(name, &db_options(self.max_open_files, &self.cache))