-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Add support for files up to 4G #88882
Open
Swatinem
wants to merge
1
commit into
master
Choose a base branch
from
swatinem/4g-files
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
+158
−24
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
90906a9
to
c604e81
Compare
This PR has a migration; here is the generated SQL for --
-- Alter field size on controlfile
--
ALTER TABLE "sentry_controlfile" DROP CONSTRAINT "sentry_controlfile_size_check";
--
-- Alter field size on controlfileblob
--
ALTER TABLE "sentry_controlfileblob" DROP CONSTRAINT "sentry_controlfileblob_size_check";
--
-- Alter field offset on controlfileblobindex
--
ALTER TABLE "sentry_controlfileblobindex" DROP CONSTRAINT "sentry_controlfileblobindex_offset_check";
--
-- Alter field size on file
--
ALTER TABLE "sentry_file" DROP CONSTRAINT "sentry_file_size_check";
--
-- Alter field size on fileblob
--
ALTER TABLE "sentry_fileblob" DROP CONSTRAINT "sentry_fileblob_size_check";
--
-- Alter field offset on fileblobindex
--
ALTER TABLE "sentry_fileblobindex" DROP CONSTRAINT "sentry_fileblobindex_offset_check"; |
❌ 1 Tests Failed:
View the top 1 failed test(s) by shortest run time
To view more test analytics, go to the Test Analytics Dashboard |
This is achieved by introducing a new `WrappingU32IntegerField` DB type. This new type implements full unsigned `u32` numbers by wrapping them around and storing them as signed `i32` values in the DB. In contrast to the existing `BoundedPositiveIntegerField`, this is not adding a DB `CHECK` constraint rejecting negative numbers. A migration was also added to change the various `size` and `offset` fields of the `File/Blob/Index` models to switch to this new type, which essentially drops the `CHECK` constraint from the DB, and thus allows negative DB values which will then be converted to a signed type on the client side.
b6db0ef
to
b4d2ed7
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is achieved by introducing a new
WrappingU32IntegerField
DB type.This new type implements full unsigned
u32
numbers by wrapping them around and storing them as signedi32
values in the DB.In contrast to the existing
BoundedPositiveIntegerField
, this is not adding a DBCHECK
constraint rejecting negative numbers. A migration was also added to change the varioussize
andoffset
fields of theFile/Blob/Index
models to switch to this new type, which essentially drops theCHECK
constraint from the DB, and thus allows negative DB values which will then be converted to a signed type on the client side.Fixes https://github.com/getsentry/team-ingest/issues/690