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

feature: Improve install process #7223

Merged
merged 1 commit into from Aug 26, 2017

Conversation

Projects
None yet
3 participants
@murrant
Member

murrant commented Aug 24, 2017

Fix incorrectly updating session with build-ok before start of schema update
Set a timeout for progress on the schema build 40s (lock wait time is 30s, so must be more than that). Allow the user to restart the process if this timeout is reached.
Animate the progress bar while waiting for the schema update. Stop animation on failure or success.
Properly destroy the session after install. This allows the user to restart if they need to without any tricks. Only need to make sure config.php does not exist.
Move next step buttons to the right.

DO NOT DELETE THIS TEXT

Please note

Please read this information carefully. You can run ./scripts/pre-commit.php to check your code before submitting.

Testers

If you would like to test this pull request then please run: ./scripts/github-apply <pr_id>, i.e ./scripts/github-apply 5926

feature: Improve install process
Fix incorrectly updating session with build-ok before start of schema update
Set a timeout for progress on the schema build 40s (lock wait time is 30s, so must be more than that).  Allow the user to restart the process if this timeout is reached.
Animate the progress bar while waiting for the schema update. Stop animation on failure or success.
Properly destroy the session after install.  This allows the user to restart if they need to without any tricks.
Move next step buttons to the right.
@@ -14,7 +14,6 @@
session_start();
if (isset($_SESSION['stage']) && $_SESSION['stage'] == 2) {
$_SESSION['build-ok'] = true;

This comment has been minimized.

@murrant

murrant Aug 24, 2017

Member

This was a bad error here :( Did not allow users to restart schema build if it failed.

@murrant

murrant Aug 24, 2017

Member

This was a bad error here :( Did not allow users to restart schema build if it failed.

@scrutinizer-notifier

This comment has been minimized.

Show comment
Hide comment
@scrutinizer-notifier

scrutinizer-notifier Aug 24, 2017

The inspection completed: No new issues

scrutinizer-notifier commented Aug 24, 2017

The inspection completed: No new issues

@laf

This comment has been minimized.

Show comment
Hide comment
@laf

laf Aug 24, 2017

Member

Nice work @murrant :)

Install works as expected, trying to simulate a failure I restarted mysql during build-base, any schema updates attempted during the restart show an error and the whole process completes and thinks it's done still. Not sure if you'd expect that to happen or not?

Member

laf commented Aug 24, 2017

Nice work @murrant :)

Install works as expected, trying to simulate a failure I restarted mysql during build-base, any schema updates attempted during the restart show an error and the whole process completes and thinks it's done still. Not sure if you'd expect that to happen or not?

@murrant

This comment has been minimized.

Show comment
Hide comment
@murrant

murrant Aug 24, 2017

Member

Thanks, I'll try making that failure happen.

Member

murrant commented Aug 24, 2017

Thanks, I'll try making that failure happen.

@murrant

This comment has been minimized.

Show comment
Hide comment
@murrant

murrant Aug 24, 2017

Member

@laf Try with ./build-base.php; echo $? that should always return non-zero during a fatal error.

But If the database build gets interrupted, the results are unpredictable. I'm not sure how to handle that. I wanted to add transactions for this at one point so we don't get inconsistent databases. Perhaps it is time to revisit that?

Member

murrant commented Aug 24, 2017

@laf Try with ./build-base.php; echo $? that should always return non-zero during a fatal error.

But If the database build gets interrupted, the results are unpredictable. I'm not sure how to handle that. I wanted to add transactions for this at one point so we don't get inconsistent databases. Perhaps it is time to revisit that?

@murrant

This comment has been minimized.

Show comment
Hide comment
@murrant

murrant Aug 25, 2017

Member

I think that should be fixed in another PR. If build-base.php returns the correct return code, then the install.php code does the right thing.

Member

murrant commented Aug 25, 2017

I think that should be fixed in another PR. If build-base.php returns the correct return code, then the install.php code does the right thing.

@laf

This comment has been minimized.

Show comment
Hide comment
@laf

laf Aug 25, 2017

Member
-- Done
1
-bash-4.2$

That's repeatable - If the restart happens during:

-- Creating base database structure
Step #0 ...
Step #1 ...
Step #2 ...
Step #3 ...
Step #4 ...
Step #5 ...
Step #6 ...

Then we get 1

If it happens after in:

-- Updating database schema
000 -> 001 ... done (0 errors).
001 -> 002 ... done (0 errors).
002 -> 003 ... done (2 errors).
003 -> 004 ... done (24 errors).
004 -> 005 ... done (11 errors).
005 -> 006 ... done (5 errors).

We get 0.

Member

laf commented Aug 25, 2017

-- Done
1
-bash-4.2$

That's repeatable - If the restart happens during:

-- Creating base database structure
Step #0 ...
Step #1 ...
Step #2 ...
Step #3 ...
Step #4 ...
Step #5 ...
Step #6 ...

Then we get 1

If it happens after in:

-- Updating database schema
000 -> 001 ... done (0 errors).
001 -> 002 ... done (0 errors).
002 -> 003 ... done (2 errors).
003 -> 004 ... done (24 errors).
004 -> 005 ... done (11 errors).
005 -> 006 ... done (5 errors).

We get 0.

@laf

This comment has been minimized.

Show comment
Hide comment
@laf
Member

laf commented Aug 25, 2017

@murrant

This comment has been minimized.

Show comment
Hide comment
@murrant

murrant Aug 26, 2017

Member

More complex than that, if things happen in the middle of stuff it will still end up broken.

I added breaks. Looking at things I discovered create table does an implicit commit.

Member

murrant commented Aug 26, 2017

More complex than that, if things happen in the middle of stuff it will still end up broken.

I added breaks. Looking at things I discovered create table does an implicit commit.

@laf laf merged commit 96cc9bf into librenms:master Aug 26, 2017

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
license/cla Contributor License Agreement is signed.
Details

@murrant murrant deleted the murrant:install-polish branch Oct 13, 2017

@lock

This comment has been minimized.

Show comment
Hide comment
@lock

lock bot May 17, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed.

lock bot commented May 17, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed.

@lock lock bot locked as resolved and limited conversation to collaborators May 17, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.