Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
i don't know of a module but have worked with large cross-platform upgrade scripts in perl, wrapped in a shell script. Anyway, the point i was going to make is that you cannot guarantee that any undo step will do the right thing, depending on the many variables involved on a server environment. in unforseen circumstances, any automated undo can wreak more havoc. the upgrade scripts i worked with had lots of sanity checking and logging of every step in a separate logging directory. in fact the upgrade could run from a separate mount point or drive, so it used as little space in main system as possible. anyway, the upgrade script had milestones for groups of smaller steps, and the script "knew" which small steps were just logged as upgrade log warnings or contributed to milestone failing and upgrade stopped. the upgrade could pick up from where it left off, as long as it was a milestone...so any human operator intervention could concentrate on either undoing or finalising a few small steps, by hand.
the kind of sanity checking and defensive programming would include such things as: if you're creating a database, try to connect and do a fake select that doesn't require a table, and or use return codes from db when executing the statement, making sure to specify username/password and admin level connect style. for creating tables, you can populate one row of the table with well chosen fake data, and make sure you can read it back and insert values match returned values. the upgrade log showed had a timestamp for each step starting and ending, and also included the information returned from any of the rigorous sanity checking, in unadulturated form returned from DB or OS etc. this allowed the upgrade operator to pinpoint fairly well exactly where things fell over.
the hardest line to type correctly is: stty erase ^H

In reply to Re: Poor man's transaction construct by aquarium
in thread Poor man's transaction construct by dgaramond2

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others chilling in the Monastery: (4)
    As of 2020-07-09 10:07 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      No recent polls found

      Notices?