Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

feat(externalMagic): Introduce external magic number (#1745) #1852

Merged
merged 1 commit into from
Feb 9, 2023

Conversation

joshua-goldstein
Copy link
Contributor

@joshua-goldstein joshua-goldstein commented Feb 6, 2023

Cherry-pick of #1745

@CLAassistant
Copy link

CLAassistant commented Feb 6, 2023

CLA assistant check
All committers have signed the CLA.

@joshua-goldstein joshua-goldstein changed the title Joshua/v3.2103.5 1745 feat(externalMagic): Introduce external magic number (#1745) Feb 6, 2023
@coveralls
Copy link

coveralls commented Feb 6, 2023

Coverage Status

Coverage: 69.966% (-0.06%) from 70.022% when pulling 4de7fb1 on joshua/v3.2103.5-1745 into 0d9e263 on release/v4.0.

@joshua-goldstein joshua-goldstein changed the base branch from release/v3.2103 to release/v4.0 February 6, 2023 21:14
@joshua-goldstein joshua-goldstein force-pushed the joshua/v3.2103.5-1745 branch 2 times, most recently from 719c331 to 4a085be Compare February 8, 2023 17:51
Badger writes a magic number in the manifest. It helps badger to decide if its current version is compatible with the data on the disk or not. But now the internal data storage of badger is not changed but the data format for dgraph has changed. This causes a problem if someone starts dgraph-2109 on an older dgraph directory. This change adds an external magic number to badger which will help avoid data corruption by causing panic if opening Dgraph on the wrong directory.

There are 8 magic bytes in the manifest.
Prior to this change:

0-4: magic text
4-8: badgerMagicNumber
After this change:

0-4: magic text
4-6: externalMagicNumber
6-8: badgerMagicNumber
(cherry picked from commit 2a9a524)
@joshua-goldstein joshua-goldstein marked this pull request as draft February 8, 2023 18:09
@joshua-goldstein joshua-goldstein marked this pull request as ready for review February 8, 2023 18:09
@joshua-goldstein joshua-goldstein changed the base branch from release/v4.0 to main February 8, 2023 18:10
@joshua-goldstein joshua-goldstein changed the base branch from main to release/v4.0 February 8, 2023 18:11
@joshua-goldstein joshua-goldstein changed the base branch from release/v4.0 to main February 9, 2023 06:21
@joshua-goldstein joshua-goldstein changed the base branch from main to release/v4.0 February 9, 2023 06:21
@mangalaman93 mangalaman93 merged commit 3045f88 into release/v4.0 Feb 9, 2023
@mangalaman93 mangalaman93 deleted the joshua/v3.2103.5-1745 branch February 9, 2023 07:59
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants