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

Update unique constraint on packages table to allow multiple versions of the same package #97

Merged
merged 4 commits into from
Nov 28, 2021

Conversation

kpcyrd
Copy link
Owner

@kpcyrd kpcyrd commented Nov 25, 2021

This allows multiple packages with the same name+version in the same distro+suite+architecture bucket and this command is working then:

REBUILDERD_COOKIE_PATH=secret/auth cargo run --bin rebuildctl -- pkgs sync-profile --sync-config contrib/confs/rebuilderd-sync.conf debian-main

But running a second import immediately after fails with this error:

rebuilderd-daemon-1  | [2021-11-25T01:00:58Z DEBUG rebuilderd::sync] pkgbase is already present: "\"zycore-c\"-\"1.1.0-3\""
rebuilderd-daemon-1  | [2021-11-25T01:00:58Z DEBUG rebuilderd::sync] pkgbase is already present: "\"zydis\"-\"3.2.1-3\""
rebuilderd-daemon-1  | [2021-11-25T01:00:58Z DEBUG rebuilderd::sync] pkgbase is already present: "\"zyn\"-\"1+git.20100609+dfsg0-4\""
rebuilderd-daemon-1  | [2021-11-25T01:00:58Z DEBUG rebuilderd::sync] pkgbase is already present: "\"zynaddsubfx\"-\"3.0.5-2\""
rebuilderd-daemon-1  | [2021-11-25T01:00:58Z DEBUG rebuilderd::sync] pkgbase is not yet present: "\"zynaddsubfx\"-\"3.0.5-2\""
rebuilderd-daemon-1  | [2021-11-25T01:00:58Z DEBUG rebuilderd::sync] pkgbase is already present: "\"zypper\"-\"1.14.42-2\""
rebuilderd-daemon-1  | [2021-11-25T01:00:58Z DEBUG rebuilderd::sync] pkgbase is not yet present: "\"zypper\"-\"1.14.42-2\""
rebuilderd-daemon-1  | [2021-11-25T01:00:58Z DEBUG rebuilderd::sync] pkgbase is already present: "\"zytrax\"-\"0+git20201215-1\""
rebuilderd-daemon-1  | [2021-11-25T01:00:58Z DEBUG rebuilderd::sync] pkgbase is already present: "\"zziplib\"-\"0.13.72+dfsg.1-1.1\""
rebuilderd-daemon-1  | [2021-11-25T01:00:58Z DEBUG rebuilderd::sync] pkgbase is already present: "\"zzuf\"-\"0.15-1\""
rebuilderd-daemon-1  | [2021-11-25T01:00:58Z DEBUG rebuilderd::sync] pkgbase is already present: "\"zzz-to-char\"-\"0.1.3-3\""
rebuilderd-daemon-1  | [2021-11-25T01:00:58Z DEBUG rebuilderd::sync] pkgbase is already present: "\"zzzeeksphinx\"-\"1.2.5-1\""
rebuilderd-daemon-1  | [2021-11-25T01:00:58Z INFO  rebuilderd::sync] found groups already in database: len=32977
rebuilderd-daemon-1  | [2021-11-25T01:00:58Z INFO  rebuilderd::sync] found groups that need to be added to database: len=4373
rebuilderd-daemon-1  | [2021-11-25T01:00:58Z INFO  rebuilderd::sync] found groups no longer present: len=0
rebuilderd-daemon-1  | [2021-11-25T01:00:58Z INFO  rebuilderd::sync] inserting new groups in batch: 1000/4373
rebuilderd-daemon-1  | [2021-11-25T01:00:58Z ERROR actix_http::response] Internal Server Error: Error { err: UNIQUE constraint failed: pkgbases.name, pkgbases.version, pkgbases.distro, pkgbases.suite, pkgbases.architecture }
rebuilderd-daemon-1  | [2021-11-25T01:00:58Z INFO  actix_web::middleware::logger] 172.21.0.1:50310 "POST /api/v0/pkgs/sync HTTP/1.1" 500 113 "-" "-" 2.368164

Instead the second run shouldn't detect any changes in groups (but it's reporting 4373 new groups).

@kpcyrd kpcyrd merged commit 6d9c574 into main Nov 28, 2021
@kpcyrd kpcyrd deleted the db branch November 28, 2021 00:18
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.

1 participant