Skip to content
This repository was archived by the owner on Sep 30, 2024. It is now read-only.

codeintel: bring audit logs upload_size type in-line with lsif_uploads table#46209

Merged
efritz merged 3 commits into
mainfrom
nsc/lsif-auditlog-column-type
Jan 9, 2023
Merged

codeintel: bring audit logs upload_size type in-line with lsif_uploads table#46209
efritz merged 3 commits into
mainfrom
nsc/lsif-auditlog-column-type

Conversation

@Strum355

@Strum355 Strum355 commented Jan 6, 2023

Copy link
Copy Markdown
Contributor

This was causing an ERROR: integer out of range (SQLSTATE 22003) error that we thought originated from the lsif_uploads table, but turns out it was from within the trigger. This wouldve been made more obvious if our errors had more info, see the output from psql:

[local:/home/noah/.sourcegraph/postgres] noah@postgres=# INSERT INTO lsif_uploads (repository_id, commit, indexer, num_parts, uploaded_parts, upload_size) VALUES (1, 'f119e4f4af4c3070d4531ae324bfd995c9f0391d', 'lsif-clang', 1, '{0}', 9223372036854775806);
ERROR:  22003: integer out of range
CONTEXT:  SQL statement "INSERT INTO lsif_uploads_audit_logs
        (upload_id, commit, root, repository_id, uploaded_at,
        indexer, indexer_version, upload_size, associated_index_id,
        content_type,
        operation, transition_columns)
        VALUES (
            NEW.id, NEW.commit, NEW.root, NEW.repository_id, NEW.uploaded_at,
            NEW.indexer, NEW.indexer_version, NEW.upload_size, NEW.associated_index_id,
            NEW.content_type,
            'create', func_lsif_uploads_transition_columns_diff(
                (NULL, NULL, NULL, NULL, NULL, NULL),
                func_row_to_lsif_uploads_transition_columns(NEW)
            )
        )"
PL/pgSQL function func_lsif_uploads_insert() line 3 at SQL statement
LOCATION:  int84, int8.c:1290
Time: 6.587 ms

The down migration may cause issues if there are entries that exceed integer size, is this ok? @efritz

Test plan

Ran it locally and it solved the issue

@Strum355 Strum355 added team/graph Graph Team (previously Code Intel/Language Tools/Language Platform) team/language-platform labels Jan 6, 2023
@Strum355 Strum355 requested a review from efritz January 6, 2023 15:59
@Strum355 Strum355 self-assigned this Jan 6, 2023
@cla-bot cla-bot Bot added the cla-signed label Jan 6, 2023
@varungandhi-src

Copy link
Copy Markdown
Contributor

I've saved an archive locally with all the data from the Chromium build and deleted the instance (it costs like $50/day); we can retry the upload after this patch lands on Sourcegraph.com

@efritz efritz enabled auto-merge (squash) January 8, 2023 03:06
@Strum355 Strum355 force-pushed the nsc/lsif-auditlog-column-type branch from 1a11aa1 to 01d00bf Compare January 9, 2023 13:08
@efritz efritz merged commit fe230b5 into main Jan 9, 2023
@efritz efritz deleted the nsc/lsif-auditlog-column-type branch January 9, 2023 13:34
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

cla-signed team/graph Graph Team (previously Code Intel/Language Tools/Language Platform)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants