Simplify 'eos evict' output message
Problem
The output of the eos evict
command can be slightly confusing, depending on the input arguments.
Example:
removed all disk replicas for 1/1 files; reduced evict counter for 0/1 files
This means:
- 1 file had all its disk replicas removed (
eos evict
command can accept a list of files). - 0 files had its evict counters reduced (not the case here, since the only file passed as a paremeter was evicted).
The actually meaning of this message can be confusing.
Code:
Proposed solution
I propose the following changes to the eos evict
ouptut message (numbers used as an example):
- If the optional arguments
--fsid <fsid>
and--ignore-evict-counter
are passed:"found and removed the fsid=123 disk replica for 5 files"
- If
--ignore-removal-on-fst
was also passed append:"(namespace only)"
- If only the optional argument
--ignore-evict-counter
is passed:"removed all disk replicas for 5 files"
- Otherwise:
- If all files got it's evict counter reduced to zero (meaning all got evicted):
"reduced evict counter for 5 files; removed all disk replicas for 5/5 files"
- If not all files got its evict counter reduced to zero:
"reduced evict counter for 5 files; removed all disk replicas for 3/5 files"
- If all files got it's evict counter reduced to zero (meaning all got evicted):