Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Zone collecting only one server logs n times #1277

Merged

Conversation

jrafanie
Copy link
Member

Pass the server receiving the synchronize_logs message. …
https://bugzilla.redhat.com/show_bug.cgi?id=1174855

If initiated from a zone, we want to create one miq_queue and miq_tasks row for each server in the Zone.

Without this change, it will create N number of rows for the server receiving the web request, MiqServer.my_server, where N is the number of active servers in the zone. It will never request logs for the other servers in the zone.

This is fairly easy to recreate:

  1. Setup a Zone with 2 or more "active" appliances (miq_servers)
  2. Request log collection for the Zone
  3. Look at the log depot and find only the logs from the server receiving the web request.

@jrafanie jrafanie added the bug label Dec 23, 2014
@Fryguy
Copy link
Member

Fryguy commented Dec 23, 2014

I'm confused how this solves the problem. Can you describe how it works now.

I would expect that the thing putting the items on the queue would just put one item per server, and use the server_guid column of the queue to ensure it gets to that one server. This seems to queue an item and then modify the queue item? I think?

@jrafanie
Copy link
Member Author

The underlying LogFile code was written when logs could be requested from the smartproxy or a server so server_guid was not an option at the time.

It works now in this way:

  • User selects a zone in the log collection screen and requests logs from that zone via Zone#synchronize_logs.
  • Zone#synchronize_logs iterates through each of the active miq servers, and calls MiqServer#synchronize_logs with *args.
  • MiqServer#synchronize_logs calls LogFile.logs_from_server(*args).
  • LogFile.logs_from_server, if no server was provided in the list of args, defaulted to MiqServer.my_server. It creates a MIqTask and MiqQueue row to collect the logs from that "thing" (miq_server or miq_proxy).

I changed MiqServer#synchronize_logs to insert the server instance into the args passed to LogFile.logs_from_server so it's not defaulted to MiqServer.my_server.

Much of this complexity can eliminated when MiqProxy is completely gone.

@jrafanie
Copy link
Member Author

In the current code, LogFile.logs_from_server gets called X times in a zone (1 time for each server in the zone), but MiqServer.my_server is the only one that gets the request, since no servers are ever passed in, so it defaults to MiqServer.my_server.

https://bugzilla.redhat.com/show_bug.cgi?id=1174855

If initiated from a zone, we want to create one miq_queue and miq_tasks row for each server in the Zone.

Without this change, it will create N number of rows for the server receiving the web request, MiqServer.my_server, where N is the number of active servers in the zone.  It will never request logs for the other servers in the zone.

This is fairly easy to recreate:
1) Setup a Zone with 2 or more "active" appliances (miq_servers)
2) Request log collection for the Zone
3) Look at the log depot and find only the logs from the server receiving the web request.
@jrafanie jrafanie force-pushed the zone_collecting_only_one_server_logs_n_times branch from c5041ff to e3fd51d Compare December 23, 2014 20:30
@miq-bot
Copy link
Member

miq-bot commented Dec 23, 2014

Checked commits jrafanie@4511cac .. jrafanie@e3fd51d with rubocop 0.27.1
3 files checked, 0 offenses detected
Everything looks good. 🍪

@jrafanie
Copy link
Member Author

jrafanie commented Jan 2, 2015

@Fryguy Does this look ok? I think I explained the issue, let me know if I should give a better example.

@jrafanie
Copy link
Member Author

ping @Fryguy is this ok?

@Fryguy
Copy link
Member

Fryguy commented Jan 13, 2015

Ugh what a mess that is. It seems to put an item on the queue to put another item on the queue to actually collect it. For now, this fixes the bug, so merging...we definitely need to clean up the rest.

Fryguy added a commit that referenced this pull request Jan 13, 2015
…r_logs_n_times

Zone collecting only one server logs n times
@Fryguy Fryguy merged commit bf1d39b into ManageIQ:master Jan 13, 2015
@Fryguy Fryguy deleted the zone_collecting_only_one_server_logs_n_times branch January 13, 2015 20:34
@Fryguy Fryguy added this to the Sprint 18 Ending Jan 27, 2015 milestone Jan 13, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants