Skip to content

Commit

Permalink
Remove LOGLEVEL DB since is no longer used (#64)
Browse files Browse the repository at this point in the history
This PR is part of the following HLD:
Persistent loglevel HLD: sonic-net/SONiC#1041

**- What I did**
Deleted the LOGLEVEL_DB.
After the Logger tables moved from the LOGLEVEL_DB to the CONFIG_DB and the jinja2_cache was deleted the LOGLEVEL_DB is not in use.

**- How I did it**
Removed the LOGLEVEL_DB from the SONiC code

**- How to verify it**
All tests were passed
  • Loading branch information
EdenGri authored Nov 14, 2022
1 parent ec32690 commit 68e0341
Show file tree
Hide file tree
Showing 8 changed files with 3 additions and 27 deletions.
1 change: 0 additions & 1 deletion cvl/cvl.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ const (
APPL_DB uint8 = 0 + iota
ASIC_DB
COUNTERS_DB
LOGLEVEL_DB
CONFIG_DB
PFC_WD_DB
FLEX_COUNTER_DB = PFC_WD_DB
Expand Down
5 changes: 0 additions & 5 deletions tools/test/database_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,6 @@
"separator": ":",
"instance" : "redis"
},
"LOGLEVEL_DB" : {
"id" : 3,
"separator": ":",
"instance" : "redis"
},
"CONFIG_DB" : {
"id" : 4,
"separator": "|",
Expand Down
4 changes: 1 addition & 3 deletions translib/db/db.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ const (
ApplDB DBNum = iota // 0
AsicDB // 1
CountersDB // 2
LogLevelDB // 3
_ // We skip number 3 since the LOGLEVEL_DB that was deprecated
ConfigDB // 4
FlexCounterDB // 5
StateDB // 6
Expand Down Expand Up @@ -307,8 +307,6 @@ func getDBInstName (dbNo DBNum) string {
return "ASIC_DB"
case CountersDB:
return "COUNTERS_DB"
case LogLevelDB:
return "LOGLEVEL_DB"
case ConfigDB:
return "CONFIG_DB"
case FlexCounterDB:
Expand Down
5 changes: 0 additions & 5 deletions translib/db/db_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,6 @@ var dbConfig = `
"separator": ":",
"instance" : "redis"
},
"LOGLEVEL_DB" : {
"id" : 3,
"separator": ":",
"instance" : "redis"
},
"CONFIG_DB" : {
"id" : 4,
"separator": "|",
Expand Down
1 change: 0 additions & 1 deletion translib/transformer/xconst.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ const (
REDIS_DB_TYPE_ASIC = "ASIC_DB"
REDIS_DB_TYPE_CONFIG = "CONFIG_DB"
REDIS_DB_TYPE_COUNTER = "COUNTERS_DB"
REDIS_DB_TYPE_LOG_LVL = "LOGLEVEL_DB"
REDIS_DB_TYPE_STATE = "STATE_DB"
REDIS_DB_TYPE_FLX_COUNTER = "FLEX_COUNTER_DB"

Expand Down
2 changes: 1 addition & 1 deletion translib/transformer/xlate_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,7 @@ func getDBOptions(dbNo db.DBNum) db.Options {
switch dbNo {
case db.ApplDB, db.CountersDB:
opt = getDBOptionsWithSeparator(dbNo, "", ":", ":")
case db.FlexCounterDB, db.AsicDB, db.LogLevelDB, db.ConfigDB, db.StateDB, db.ErrorDB, db.UserDB:
case db.FlexCounterDB, db.AsicDB, db.ConfigDB, db.StateDB, db.ErrorDB, db.UserDB:
opt = getDBOptionsWithSeparator(dbNo, "", "|", "|")
}

Expand Down
2 changes: 0 additions & 2 deletions translib/transformer/xspec.go
Original file line number Diff line number Diff line change
Expand Up @@ -679,8 +679,6 @@ func dbNameToIndex(dbName string) db.DBNum {
dbIndex = db.AsicDB
case "COUNTERS_DB" :
dbIndex = db.CountersDB
case "LOGLEVEL_DB" :
dbIndex = db.LogLevelDB
case "CONFIG_DB" :
dbIndex = db.ConfigDB
case "FLEX_COUNTER_DB" :
Expand Down
10 changes: 1 addition & 9 deletions translib/translib.go
Original file line number Diff line number Diff line change
Expand Up @@ -1051,14 +1051,6 @@ func getAllDbs(isGetCase bool) ([db.MaxDB]*db.DB, error) {
return dbs, err
}

//Create Log Level DB connection
dbs[db.LogLevelDB], err = db.NewDB(getDBOptions(db.LogLevelDB, isWriteDisabled))

if err != nil {
closeAllDbs(dbs[:])
return dbs, err
}

isWriteDisabled = true

//Create Config DB connection
Expand Down Expand Up @@ -1121,7 +1113,7 @@ func getDBOptions(dbNo db.DBNum, isWriteDisabled bool) db.Options {
switch dbNo {
case db.ApplDB, db.CountersDB, db.AsicDB:
opt = getDBOptionsWithSeparator(dbNo, "", ":", ":", isWriteDisabled)
case db.FlexCounterDB, db.LogLevelDB, db.ConfigDB, db.StateDB:
case db.FlexCounterDB, db.ConfigDB, db.StateDB:
opt = getDBOptionsWithSeparator(dbNo, "", "|", "|", isWriteDisabled)
}

Expand Down

0 comments on commit 68e0341

Please sign in to comment.