This repository has been archived by the owner on Jul 25, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 37
Conversation
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
There is currently a case in which a stale entries are being left in the influx db. This takes place when a filesystem is mounted, data is pulled into influx, and then another filesystem is mounted, and both filesystems use the same mgs. For example: time n: mgs_fs: "fs" time n+1: mgs_fs: "fs2" time n+2: mgs_fs: "fs,fs2" Currently, only items matching "fs,fs2" will be removed, since that's the current input. This results in entries in the target table showing that the filesystems are: "fs, fs2, fs,fs2". This patch ensures that all subsets of the input filesystems are deleted and all but the last of the current subset is deleted. Signed-off-by: johnsonw <wjohnson@whamcloud.com>
johnsonw
force-pushed
the
fix-fs-in-target-table
branch
from
November 11, 2020 14:49
66efeae
to
261e046
Compare
jgrund
reviewed
Nov 11, 2020
let mgs_fs = record.mgs_fs.to_string(); | ||
let mut entry = acc.entry(mgs_fs).or_insert((0, 0)); | ||
|
||
if record.time > 0 { |
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.
In what case will this be <= 0?
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.
SELECT mgs_fs, mgs_fs_count FROM (SELECT count(is_mgs_fs) AS mgs_fs_count FROM target WHERE is_mgs_fs=true GROUP BY mgs_fs),(SELECT LAST(is_mgs_fs) as last_time FROM target GROUP BY mgs_fs) group by mgs_fs
name: target
tags: mgs_fs=6463788d,fs,fs2
time mgs_fs mgs_fs_count
---- ------ ------------
0 6463788d,fs,fs2 408
1604958244843905323 6463788d,fs,fs2
name: target
tags: mgs_fs=fs
time mgs_fs mgs_fs_count
---- ------ ------------
0 fs 105
1604970477758642988 fs
name: target
tags: mgs_fs=fs,fs2
time mgs_fs mgs_fs_count
---- ------ ------------
0 fs,fs2 417
1604975047786615296 fs,fs2
Signed-off-by: johnsonw <wjohnson@whamcloud.com>
jgrund
reviewed
Nov 11, 2020
jgrund
approved these changes
Nov 11, 2020
ip1981
reviewed
Nov 12, 2020
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There is currently a case in which a stale entries are being left in the
influx db. This takes place when a filesystem is mounted, data is pulled
into influx, and then another filesystem is mounted, and both
filesystems use the same mgs. For example:
time n:
mgs_fs: "fs"
time n+1:
mgs_fs: "fs2"
time n+2:
mgs_fs: "fs,fs2"
Currently, only items matching "fs,fs2" will be removed, since that's
the current input. This results in entries in the target table showing
that the filesystems are: "fs, fs2, fs,fs2".
This patch ensures that all subsets of the input filesystems are deleted
and all but the last of the current subset is deleted.
Signed-off-by: johnsonw wjohnson@whamcloud.com
This change is