-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(Upgrade): Users can now upgrade to v20.07.0 (#5634)
Fixes #DGRAPH-1617. This PR adds the capability to upgrade to v20.07.0 from v20.03.0+ It has only considered the breaking changes introduced in #5185. It also introduces a generic system to handle upgrades. At present, upgrade tool expects to handle only breaking ACL changes, and does not expect to handle badger data format changes. The way it is supposed to work is by updating the Dgraph binary to new version, start Dgraph cluster with existing data directories (which could also have been restored by enterprise backup/restore), and then running the upgrade tool by specifying the version you want to upgrade from and the version you want to upgrade to.
- Loading branch information
1 parent
f29c5bb
commit d5892dc
Showing
8 changed files
with
1,084 additions
and
74 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
/* | ||
* Copyright 2020 Dgraph Labs, Inc. and Contributors | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package upgrade | ||
|
||
func init() { | ||
allChanges = changeList{ | ||
{ | ||
introducedIn: &version{major: 20, minor: 3, patch: 0}, | ||
changes: []*change{{ | ||
name: "Upgrade ACL Rules", | ||
description: "This updates the ACL nodes to use the new ACL model introduced in" + | ||
" v20.03.0. This is applied while upgrading from v1.2.2+ to v20.03.0+", | ||
minFromVersion: &version{major: 1, minor: 2, patch: 2}, | ||
applyFunc: upgradeACLRules, | ||
}}, | ||
}, | ||
{ | ||
introducedIn: &version{major: 20, minor: 7, patch: 0}, | ||
changes: []*change{ | ||
{ | ||
name: "Upgrade ACL Type names", | ||
description: "This updates the ACL nodes to use the new type names for the" + | ||
" types User, Group and Rule. They are now dgraph.type.User, " + | ||
"dgraph.type.Group, and dgraph.type.Rule. This change was introduced in " + | ||
"v20.07.0, and is applied while upgrading from v20.03.0+ to v20.07.0+. " + | ||
"For more info, see: https://github.com/dgraph-io/dgraph/pull/5185", | ||
minFromVersion: &version{major: 20, minor: 3, patch: 0}, | ||
applyFunc: upgradeAclTypeNames, | ||
}, | ||
// another change in 20.07.0 version is if someone was having types/predicates in | ||
// reserved namespace, then data should be migrated for such cases, | ||
// to not use the reserved namespace. Migration is expected to be done by the user, | ||
// and we will only provide a documentation mentioning the steps to be taken. | ||
// This is not being automated because: | ||
// 1. There is very less chance that someone was using the reserved namespace, | ||
// so this automation may not be used at all. | ||
// 2. The data migration can be huge, if needed to migrate. The automated code | ||
// can't handle every scenario. So, it is best to let the user do it. | ||
}, | ||
}, | ||
} | ||
} |
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
Oops, something went wrong.