Bug 846041 - "rhc-outage sync" pushes blindly to other hosts, doesn't sync from other hosts,
Summary: "rhc-outage sync" pushes blindly to other hosts, doesn't sync from other hosts,
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: OKD
Classification: Red Hat
Component: Website
Version: 2.x
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: ---
: ---
Assignee: Fotios Lindiakos
QA Contact: libra bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-08-06 15:56 UTC by Matt Woodson
Modified: 2015-05-15 01:13 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-09-17 21:30:00 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Matt Woodson 2012-08-06 15:56:12 UTC
Description of problem:

I installed a new ex-srv1.prod.  /app/status web page came up blank (nothing the the outabe sqlite DB).  The others nodes had the complete outage history.

I wanted to sync ex-srv1.prod, so on ex-srv1.prod I ran the following command:

============================================================
[root status]# bundle exec ./rhc-outage sync
Syncing https://ex-srv2.prod.rhcloud.com/app/status
        Success
Syncing https://ex-srv3.prod.rhcloud.com/app/status
        Success
Syncing https://ex-srv4.prod.rhcloud.com/app/status
        Success
============================================================

This pushed out the blank DB to all the other nodes.

The db doesn't need to be blank, it just needs to be different. The one that is pushing will be treated as authoritative.

This sync is doing a push, rather than a true sync.


How reproducible:
100%

Steps to Reproduce:
1. have a blank status.sqlite3 on one ex-srv1
2. have a populated db on another ex-srv2
3. run "bundle exec ./rhc-outage sync" on ex-srv1

  
Actual results:

on ex-srv2 that the db is now blank.

Expected results:

I would expect ex-srv1 to be brought up to date from ex-srv2.

If this couldn't happen, I would expect a warning saying that things are newer on ex-srv2.

Additional info:

It would also be extremely useful if the sync script would make a backup of the existing DB before overwriting it or re-creating it.

Comment 1 John Poelstra 2012-08-21 17:24:21 UTC
fotios will research immediately and send out plans

Comment 2 Fotios Lindiakos 2012-08-21 20:38:52 UTC
I've updated the app to include backup and restore functionality. Currently in https://github.com/openshift/li/pull/288

Comment 3 Fotios Lindiakos 2012-08-22 18:02:08 UTC
The pull request has been updated to address this issue. This was not a bug, but just an unclear usage.

I've removed the sync feature and replaced it with a push feature which will also do some additional checks.

Comment 4 Meng Bo 2012-08-23 09:21:45 UTC
Checked on devenv_2062, sync action has been replaced by push. 
According to the devel's comment, just make the usage clearly. 
Mark the bug as verified.

===========
[root@ip-10-114-50-194 status]# bundle exec ./rhc-outage 
Tasks:
  rhc-outage clear                         # Clear all issues/updates from this host
  rhc-outage help [TASK]                   # Describe available tasks or one specific task
  rhc-outage list                          # List all issues
  rhc-outage new TITLE DESCRIPTION         # Start a new issue with and describe what is going on/affected
  rhc-outage push                          # Push this host's status to all other hosts
  rhc-outage resolve ISSUE_ID DESCRIPTION  # Resolve an issue with a final update. Description is required.
  rhc-outage update ISSUE_ID DESCRIPTION   # Add an update to an issue without resolving it


Note You need to log in before you can comment on or make changes to this bug.