Skip to content

Commit

Permalink
global params: rename LogRemainToSendMBytes
Browse files Browse the repository at this point in the history
Since not all logs in persist are to be sent, we rename
LogRemainToSendMBytes to MaxGzipLogMBytesInPersist. This
parameter represents the maxinum size of all gzipped logs
in persist.

Signed-off-by: Paul Gaiduk <paulg@zededa.com>
  • Loading branch information
europaul committed Jan 10, 2025
1 parent 7192337 commit 58d6ee9
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion pkg/pillar/cmd/volumemgr/sizemgmt.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ func getRemainingDiskSpace(ctxPtr *volumemgrContext) (uint64, error) {
// Everything in /persist except these directories/datasets counts
// as EVE overhead.
// Note that we also exclude /persist/newlog here since it maintains its own
// size limit (GlobalValueInt(types.LogRemainToSendMBytes)) the caller
// size limit (GlobalValueInt(types.MaxGzipLogMBytesInPersist)) the caller
// needs to consider as EVE overhead.
var excludeDirs = append(types.AppPersistPaths, types.NewlogDir)

Expand Down
2 changes: 1 addition & 1 deletion pkg/pillar/diskmetrics/usage.go
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ func Dom0DiskReservedSize(log *base.LogObject, globalConfig *types.ConfigItemVal
(float64(dom0MinDiskUsagePercent) * 0.01))
staticMaxDom0DiskSize := uint64(globalConfig.GlobalValueInt(
types.Dom0DiskUsageMaxBytes))
newlogReserved := uint64(globalConfig.GlobalValueInt(types.LogRemainToSendMBytes))
newlogReserved := uint64(globalConfig.GlobalValueInt(types.MaxGzipLogMBytesInPersist))
// Always leave space for /persist/newlogd
maxDom0DiskSize := newlogReserved
// Select the larger of the current overhead usage and the configured
Expand Down
8 changes: 4 additions & 4 deletions pkg/pillar/types/global.go
Original file line number Diff line number Diff line change
Expand Up @@ -209,8 +209,8 @@ const (
AppContainerStatsInterval GlobalSettingKey = "timer.appcontainer.stats.interval"
// VaultReadyCutOffTime global setting key
VaultReadyCutOffTime GlobalSettingKey = "timer.vault.ready.cutoff"
// LogRemainToSendMBytes Max gzip log files remain on device to be sent in Mbytes
LogRemainToSendMBytes GlobalSettingKey = "newlog.gzipfiles.ondisk.maxmegabytes"
// MaxGzipLogMBytesInPersist Max size of gzip log files in persist in Mbytes
MaxGzipLogMBytesInPersist GlobalSettingKey = "newlog.gzipfiles.ondisk.maxmegabytes"

// ForceFallbackCounter global setting key
ForceFallbackCounter = "force.fallback.counter"
Expand Down Expand Up @@ -960,8 +960,8 @@ func NewConfigItemSpecMap() ConfigItemSpecMap {
eveMemoryLimitInMiB, 0xFFFFFFFF)
// Limit manual vmm overhead override to 1 PiB
configItemSpecMap.AddIntItem(VmmMemoryLimitInMiB, 0, 0, uint32(1024*1024*1024))
// LogRemainToSendMBytes - Default is 2 Gbytes, minimum is 10 Mbytes
configItemSpecMap.AddIntItem(LogRemainToSendMBytes, 2048, 10, 0xFFFFFFFF)
// MaxGzipLogMBytesInPersist - Default is 2 Gbytes, minimum is 10 Mbytes
configItemSpecMap.AddIntItem(MaxGzipLogMBytesInPersist, 2048, 10, 0xFFFFFFFF)
configItemSpecMap.AddIntItem(DownloadMaxPortCost, 0, 0, 255)
configItemSpecMap.AddIntItem(BlobDownloadMaxRetries, 5, 1, 10)

Expand Down
2 changes: 1 addition & 1 deletion pkg/pillar/types/global_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ func TestNewConfigItemSpecMap(t *testing.T) {
Dom0DiskUsageMaxBytes,
StorageZfsReserved,
ForceFallbackCounter,
LogRemainToSendMBytes,
MaxGzipLogMBytesInPersist,
DownloadMaxPortCost,
BlobDownloadMaxRetries,
// Bool Items
Expand Down

0 comments on commit 58d6ee9

Please sign in to comment.