-
Notifications
You must be signed in to change notification settings - Fork 688
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
Copp Changes #1004
Copp Changes #1004
Changes from 3 commits
d3f51dd
0c83b06
439d803
fbf7b22
da0e265
6954f70
63ccd7b
b781463
5310d32
eb43280
3aebe24
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -142,6 +142,17 @@ def migrate_intf_table(self): | |
self.appDB.set(self.appDB.APPL_DB, table, 'NULL', 'NULL') | ||
if_db.append(if_name) | ||
|
||
def migrate_copp_table(self): | ||
''' | ||
Delete the existing COPP table | ||
''' | ||
if self.appDB is None: | ||
return | ||
|
||
keys = self.appDB.keys(self.appDB.APPL_DB, "COPP_TABLE:*") | ||
for copp_key in keys: | ||
self.appDB.delete(self.appDB.APPL_DB, copp_key) | ||
|
||
def version_unknown(self): | ||
""" | ||
version_unknown tracks all SONiC versions that doesn't have a version | ||
|
@@ -199,17 +210,16 @@ def version_1_0_3(self): | |
if self.asic_type == "mellanox": | ||
if self.mellanox_buffer_migrator.mlnx_migrate_buffer_pool_size('version_1_0_3', 'version_1_0_4') and self.mellanox_buffer_migrator.mlnx_migrate_buffer_profile('version_1_0_3', 'version_1_0_4'): | ||
self.set_version('version_1_0_4') | ||
else: | ||
self.set_version('version_1_0_4') | ||
|
||
self.migrate_copp_table() | ||
self.set_version('version_1_0_4') | ||
return 'version_1_0_4' | ||
|
||
def version_1_0_4(self): | ||
""" | ||
Current latest version. Nothing to do here. | ||
""" | ||
log.log_info('Handling version_1_0_4') | ||
|
||
return None | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please upgrade to version_1_0_5 and create function version_1_0_5 with previous code in version_1_0_4. You need to mark that upgrade is done. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Had a discussion with @yxieca . @dgsudharsan, can we do it as part of an outer function so that this is called always instead of copying to each later versions? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. sure. after offline discussion. I think we need to put 'always apply at latest version' operations after the main upgrade loop. |
||
|
||
def get_version(self): | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -246,6 +246,14 @@ function backup_database() | |
end | ||
end | ||
" 0 > /dev/null | ||
# Delete COPP_TABLE keys in APPL_DB | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As discussed, we can remove this section |
||
sonic-db-cli APPL_DB eval " | ||
for _, k in ipairs(redis.call('keys', '*')) do | ||
if string.match(k, 'COPP_TABLE:') then | ||
redis.call('del', k) | ||
end | ||
end | ||
" 0 > /dev/null | ||
sonic-db-cli SAVE > /dev/null | ||
#TODO : need a script to copy all rdb files if there is multiple db instances config | ||
docker cp database:/var/lib/redis/$REDIS_FILE $WARM_DIR | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lets have copp table migration as part of
1_0_4
? and set new as1_0_5
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
202006 version had the release version as 1_0_3. Is it ok to bump up the version twice to 1_0_5 between releases?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can have this part of the current version so as to execute this always