jjneely / buckytools

Go implementation of useful tools for dealing with Graphite's Whisper DBs and Carbon hashing
Other
87 stars 21 forks source link

Commandline switch -s/-single does not seem to have any effect #27

Open rsommer opened 7 years ago

rsommer commented 7 years ago

While integrating some monitoring checks using buckytools I encountered that the -s/-single flag does not seem to restrict for example 'inconsistent' to just a single host as advertised in the help text. Am I missing something from the documentation or did I just hit a bug? I'm currently using buckytools 0.3.2.

To reproduce, just create some empty bogus whisper files on the wrong host(s) and call bucky inconsistent -s. I tried various combinations but from a quick look at the code I can not find a place where the command line flag is actually read and handled except for the restore command. The SetupSingle method is called from rebalance, inconsistent etc. and the help text states that these operations can also be restricted to a single host.

deniszh commented 7 years ago

Hi @rsommer, I'm wondering what's expected behaviour of bucky inconsistent -s should be? Report inconsistency on single host only? I'm using -single for non-standard rebalance operations, e.g. copy all metrics from one host to another:

user@host002 # bucky rebalance  -no-delete -w 4 -single host001:4242
rsommer commented 7 years ago

The specific usecase on my side is that I want to implement monitoring checks bound to the single hosts of the cluster so that every host just reports back wrong metrics on itself. If this is no intended behaviour the help text for operations not supporting single host mode should not advertise the flag. I added handling of the flag and could issue a pull request or just keep it for myself if the intended behaviour is as it is now.

deniszh commented 7 years ago

I'm not an author of bucky, just a curious user, was wondering about usecase here. Looks pretty valid to me.

rsommer commented 7 years ago

@deniszh I'm wondering about your example from above: the only command where the SingleHost-flag is actually evaluated is in restore.go. If I do a dry run of a rebalance using -s/-single all metrics are processed nervertheless. Which version of buckytools are you using?

deniszh commented 7 years ago

My old fork, from the times when jumphash was not merged into master branch

On Mon, 18 Sep 2017 at 16:32, Roland Sommer notifications@github.com wrote:

@deniszh https://github.com/deniszh I'm wondering about your example from above: the only command where the SingleHost-flag is actually evaluated is in restore.go. If I do a dry run of a rebalance using -s/-single all metrics are processed nervertheless. Which version of buckytools are you using?

— You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub https://github.com/jjneely/buckytools/issues/27#issuecomment-330242129, or mute the thread https://github.com/notifications/unsubscribe-auth/ABK51nAGBjosCi5iOACZTR5-TYA1i_37ks5sjn70gaJpZM4Pa5gv .

jjneely commented 7 years ago

Hey, I'm totally accepting PRs. :-)

dcharleston commented 5 years ago

@deniszh I don't see any history of the -s flag ever functioning for rebalance, do you have uncommitted changes on your older fork for that?

@rsommer I'd be interested in your handling of the single host though my use case is basically what deniszh does with the rebalance command. Do you have a PR or commit I can look at?

deniszh commented 5 years ago

@dcharleston: I did nothing for rebalance , it was just working for me out of the box. I’m not actively using buckytools anymore, but you can check this fork for some additions and patches - https://github.com/go-graphite/buckytools

dcharleston commented 5 years ago

@deniszh Thanks, i'm curious to know what you're using now?

I still fail to see where the actual logic is that calls SingleHost function in rebalance.go is unless there is some go magic I don't understand, which may very well be the case.

deniszh commented 5 years ago

@dcharleston : TBH I completely forgot buckytools code. For me, command above bucky rebalance -no-delete -w 4 -single host001:4242 just copy all files from to host001 to current host.