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

How to recover from ConflictOnIndexDataDeleteSync? #1473

Open
Carterj3 opened this issue Apr 15, 2024 · 0 comments
Open

How to recover from ConflictOnIndexDataDeleteSync? #1473

Carterj3 opened this issue Apr 15, 2024 · 0 comments

Comments

@Carterj3
Copy link

I've been using GlueSQL w/ Sled and whenever I try to do stuff w/ map_id=67433 in the map table I get a ConflictOnIndexDataDeleteSync error. I've tried to do a DROP INDEX for all the indices but that also gives a ConflictOnIndexDataDeleteSync.

I've stuck the 2.7 GB db (compressed down to ~814MB) here (https://cards.lesuorac.com/archive.db.gz) but it'll probably only be there for a couple weeks.

Below is also how I configured the db using GlueSQL.

pub const REPLAYS_TABLE: &'static str = "replays";
pub const MAPS_TABLE: &'static str = "map";

pub const SYSTEM_VALUES_TABLE: &'static str = "system_values";
pub const SYSTEM_VALUES_VERSION_DATABASE: &'static str = "version-database";

 let mut storage = SledStorage::try_from(
            Config::new()
                .path(args.database_path)
                .mode(sled::Mode::HighThroughput)
                .cache_capacity(8 * 1024 * 1024 * 1024 /* 8 GB */)
                .flush_every_ms(Some(5000)),
        )
        .expect("Failed to create database.");

glue.execute(format!(
            "   CREATE TABLE IF NOT EXISTS {REPLAYS_TABLE} (
                                id UUID PRIMARY KEY,
                                game_id UINT64 UNIQUE NOT NULL,
                                game_name Text NOT NULL,
                                map_id UINT64 NOT NULL
                    );
                CREATE INDEX index__replays__id ON {REPLAYS_TABLE} (id);
                CREATE INDEX index__replays__game_id ON {REPLAYS_TABLE} (game_id);
                CREATE INDEX index__replays__map_id ON {REPLAYS_TABLE} (map_id);

                CREATE TABLE IF NOT EXISTS {MAPS_TABLE} (
                                id UUID PRIMARY KEY,
                                map_id UINT64 UNIQUE NOT NULL,
                                map_author Text NOT NULL,
                                last_updated Timestamp NOT NULL,
                                last_checked Timestamp NOT NULL
                    );
                CREATE INDEX index__maps__id ON {MAPS_TABLE} (id);
                CREATE INDEX index__maps__map_id ON {MAPS_TABLE} (map_id);
                CREATE INDEX index__maps__map_author ON {MAPS_TABLE} (map_author);

                CREATE TABLE IF NOT EXISTS {SYSTEM_VALUES_TABLE} (
                    key TEXT PRIMARY KEY,
                    value BYTEA NOT NULL
                );
                CREATE INDEX index__system_values__key ON {SYSTEM_VALUES_TABLE} (key);
                        
                         ",
        ))
        .await?;
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

No branches or pull requests

1 participant