[Prev][Next][Index][Thread]

# Panic recovery of a database - eg, BatMOO

- Date: Tue, 28 Nov 1995 02:50:24 PST
- From:
- Content-Type: MULTIPART/MIXED; BOUNDARY="617251110-1251394195-817555824=:1709"

    Hi.

    It appears as if BatMOO was saved by another method, but here is
    something I've knocked up that should work to the extent of re-creating
    your entire DB, to perfection, with the sole exclusion of forked and
    suspended tasks.

    I have tested it on my system, connected via 'Local Loopback', ie, both
    the MOO and I are running on the same machine, and not actually over the net.

    I have no idea what the result of trying this over the net will be.  Lag
    might cause serious problems with the high frequency of notify() calls,
    resulting in buffer overruns, etc.  If that is the case, sprinkle a few
    liberal suspends(10) or so in the code.  I just don't have the time or
    inclination right now to do a full net test.

    I'd appreciate an independant test and some feedback.

    	Ian.

    DQoNClByb2NlZHVyZSB0byBwYW5pYy1yZWNvdmVyIGEgZGF0YWJhc2UgZnJv
    bSB0aGUgUGFuaWMuZGINCj09PT09PT09PT09PT09PT09PT09PT09PT09PT09
    PT09PT09PT09PT09PT09PT09PT09PT09PT0NCg0KVGhpcyBzaG91bGQgYWxs
    b3cgeW91IHRvIHJlY292ZXIgeW91ciBNT08ncyBkYiBmcm9tIGNhdGFzdHJv
    cGhpYyBlcmFkaWNhdGlvbg0Kb2YgdGhlIGRiIGZpbGUgaXRzZWxmLg0KDQpJ
    dCB3aWxsIHdvcmsgd2l0aCBib3RoIDEuNy44cDQgYXMgd2VsbCBhcyB0aGUg
    bmV3IDEuNy45IHNlcmllcy4gIEl0IGlzIGFsc28NCmVudGlyZWx5IGluZGVw
    ZW5kYW50IG9mIHRoZSBjb3JlIHlvdSBhcmUgdXNpbmcuICBIZXJlJ3Mgd2hh
    dCB0byBkby4NCg0KQm9vdCB1cCBhIG1vbyB1c2luZyB0aGUgc3VwcGxpZWQg
    UGFuaWMuZGIsIE9SIGNyZWF0ZSB5b3VyIG93biBmcm9tDQpNaW5pbWFsLmRi
    IGJ5IHVwbG9hZGluZyB0aGUgZmlsZSBwYW5pYy5tDQoNCklmIHl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MSkiKTsNCiAgbm90aWZ5KHBs
    YXllciwgdG9zdHIoIjtjaHBhcmVudCgiLCBvLCAiLCAjLTEpIikpOw0KZW5k
    Zm9yDQpzdXNwZW5kKDApOw0KLg0KDQoNCg0KO2FkZF92ZXJiKHBsYXllciwg
    e3BsYXllciwgInJ4ZCIsICJfX3NldF9wbGF5ZXJzIn0sIHsidGhpcyIsICJu
    b25lIiwgInRoaXMifSkNCg0KLnByb2dyYW0gbWU6X19zZXRfcGxheWVycw0K
    InNldCBwcm9ncmFtbWVyIGFuZCB3aXphcmQgYml0cyBpZiByZXF1aXJlZCwg
    c2V0IHBsYXllciBmbGFnIGZvciBwbGF5ZXJzIjsNCiJzcGVjaWZpY2FsbHkg
    ZXhjbHVkZSAjMyI7DQpmb3IgaSBpbiBbMC4udG9udW0obWF4X29iamVjdCgp
    KV0NCiAgdGlja3NfbGVmdCgpIDwgMTAwMCB8fCBzZWNvbmRzX2xlZnQoKSA9
    PSAxID8gc3VzcGVuZCgwKSB8ICIiOw0KICBvID0gdG9vYmooaSk7DQogIGlm
    ICh2YWxpZChvKSAmJiBvICE9ICMzKQ0KICAgIGlmIChvLnByb2dyYW1tZXIg
    fHwgby53aXphcmQgfHwgaXNfcGxheWVyKG8pKQ0KICAgICAgbm90aWZ5KHBs
    YXllciwgdG9zdHIoIjtzZXRfcGxheWVyX2ZsYWcoIiwgbywgIiwxKSIpKTsN
    CiAgICAgIGlmIChvLnByb2dyYW1tZXIpDQogICAgICAgIG5vdGlmeShwbGF5
    ZXIsIHRvc3RyKCI7IiwgbywgIi5wcm9ncmFtbWVyID0gMSIpKTsNCiAgICAg
    IGVuZGlmDQogICAgICBpZiAoby53aXphcmQpDQogICAgICAgIG5vdGlmeShw
    bGF5ZXIsIHRvc3RyKCI7IiwgbywgIi53aXphcmQgPSAxIikpOw0KICAgICAg
    ZW5kaWYNCiAgICAgIGlmICghaXNfcGxheWVyKG8pKQ0KICAgICAgICBub3Rp
    ZnkocGxheWVyLCB0b3N0cigiO3NldF9wbGF5ZXJfZmxhZygiLCBvLCAiLDAp
    IikpOw0KICAgICAgZW5kaWYNCiAgICBlbmRpZg0KICBlbmRpZg0KZW5kZm9y
    DQpzdXNwZW5kKDApOw0KLg0KDQoNCjthZGRfdmVyYihwbGF5ZXIsIHtwbGF5
    ZXIsICJyeGQiLCAiX19zZXRfbGluZWFnZSJ9LCB7InRoaXMiLCAibm9uZSIs
    ICJ0aGlzIn0pDQoNCi5wcm9ncmFtIG1lOl9fc2V0X2xpbmVhZ2UNCiJzZXQg
    cGFyZW50IGF0dHJpYnV0ZXMgb2YgYWxsIG9iamVjdHMiOw0KZm9yIGkgaW4g
    WzAuLnRvbnVtKG1heF9vYmplY3QoKSldDQogIHRpY2tzX2xlZnQoKSA8IDEw
    MDAgfHwgc2Vjb25kc19sZWZ0KCkgPT0gMSA/IHN1c3BlbmQoMCkgfCAiIjsN
    CiAgbyA9IHRvb2JqKGkpOw0KICBpZiAodmFsaWQobykgJiYgdmFsaWQocGFy
    ZW50KG8pKSkNCiAgICBub3RpZnkocGxheWVyLCB0b3N0cigiO2NocGFyZW50
    KCIsIG8sICIsICIsIHBhcmVudChvKSwgIikiKSk7DQogIGVuZGlmDQplbmRm
    b3INCnN1c3BlbmQoMCk7DQouDQoNCg0KDQo7YWRkX3ZlcmIocGxheWVyLCB7
    cGxheWVyLCAicnhkIiwgIl9fc2V0X2luYnVpbHQifSwgeyJ0aGlzIiwgIm5v
    bmUiLCAidGhpcyJ9KQ0KDQoucHJvZ3JhbSBtZTpfX3NldF9pbmJ1aWx0DQoi
    c2V0IGluYnVpbHQgcHJvcGVydGllcyBvZiBhbGwgb2JqZWN0cyI7DQpmb3Ig
    aSBpbiBbMC4udG9udW0obWF4X29iamVjdCgpKV0NCiAgdGlja3NfbGVmdCgp
    IDwgMTAwMCB8fCBzZWNvbmRzX2xlZnQoKSA9PSAxID8gc3VzcGVuZCgwKSB8
    ICIiOw0KICBvID0gdG9vYmooaSk7DQogIGlmICh2YWxpZChvKSkNCiAgICBu
    b3RpZnkocGxheWVyLCB0b3N0cigiOyIsIG8sICIubmFtZSA9ICIsIHRoaXM6
    dG9saXRlcmFsKG8ubmFtZSkpKTsNCiAgICBub3RpZnkocGxheWVyLCB0b3N0
    cigiOyIsIG8sICIub3duZXIgPSAiLCBvLm93bmVyKSk7DQogICAgaWYgKG8u
    bG9jYXRpb24gIT0gIy0xKQ0KICAgICAgbm90aWZ5KHBsYXllciwgdG9zdHIo
    Ijttb3ZlKCIsIG8sICIsIiwgby5sb2NhdGlvbiwgIikiKSk7DQogICAgZW5k
    aWYNCiAgICBpZiAoby5yKQ0KICAgICAgbm90aWZ5KHBsYXllciwgdG9zdHIo
    IjsiLCBvLCAiLnIgPSAiLCBvLnIpKTsNCiAgICBlbmRpZg0KICAgIGlmIChv
    LncpDQogICAgICBub3RpZnkocGxheWVyLCB0b3N0cigiOyIsIG8sICIudyA9
    ICIsIG8udykpOw0KICAgIGVuZGlmDQogICAgaWYgKG8uZikNCiAgICAgIG5v
    dGlmeShwbGF5ZXIsIHRvc3RyKCI7IiwgbywgIi5mID0gIiwgby5mKSk7DQog
    ICAgZW5kaWYNCiAgZW5kaWYNCmVuZGZvcg0Kc3VzcGVuZCgwKTsNCi4NCg0K
    DQoNCjthZGRfdmVyYihwbGF5ZXIsIHtwbGF5ZXIsICJyeGQiLCAiX19jcmVh
    dGVfdmVyYnMifSwgeyJ0aGlzIiwgIm5vbmUiLCAidGhpcyJ9KQ0KDQoucHJv
    Z3JhbSBtZTpfX2NyZWF0ZV92ZXJicw0KImNyZWF0ZSBhbGwgdmVyYnMgb24g
    YWxsIG9iamVjdHMiOw0KZm9yIGkgaW4gWzAuLnRvbnVtKG1heF9vYmplY3Qo
    KSldDQogIG8gPSB0b29iaihpKTsNCiAgaWYgKHZhbGlkKG8pKQ0KICAgIHZl
    cmJzID0gdmVyYnMobyk7DQogICAgZm9yIHYgaW4gWzAuLmxlbmd0aCh2ZXJi
    cyktMV0NCiAgICAgIHRpY2tzX2xlZnQoKSA8IDEwMDAgfHwgc2Vjb25kc19s
    ZWZ0KCkgPT0gMSA/IHN1c3BlbmQoMCkgfCAiIjsNCiAgICAgIHZpID0gdGhp
    czp0b2xpdGVyYWwodmVyYl9pbmZvKG8sIHRvc3RyKHYpKSk7DQogICAgICB2
    YSA9IHRoaXM6dG9saXRlcmFsKHZlcmJfYXJncyhvLCB0b3N0cih2KSkpOw0K
    ICAgICAgbm90aWZ5KHBsYXllciwgdG9zdHIoIjthZGRfdmVyYigiLCBvLCAi
    LCAiLCB2aSwgIiwgIiwgdmEsICIpIikpOw0KICAgICAgdmMgPSB2ZXJiX2Nv
    ZGUobywgdG9zdHIodiksIDAsIDEpOw0KICAgICAgY3YgPSB2ZXJic1t2KzFd
    Ow0KICAgICAgaWYgKG9mZnNldCA9IGluZGV4KGN2LCAiICIpKQ0KICAgICAg
    ICBjdiA9IGN2WzEuLm9mZnNldC0xXTsNCiAgICAgIGVuZGlmDQogICAgICBj
    diA9IHN0cnN1YihjdiwgIioiLCAiIik7DQogICAgICBub3RpZnkocGxheWVy
    LCB0b3N0cigiLnByb2dyYW0gIiwgbywgIjoiLCBjdikpOw0KICAgICAgZm9y
    IGwgaW4gKHZjKQ0KICAgICAgICB0aWNrc19sZWZ0KCkgPCAxMDAwIHx8IHNl
    Y29uZHNfbGVmdCgpID09IDEgPyBzdXNwZW5kKDApIHwgIiI7DQogICAgICAg
    IG5vdGlmeShwbGF5ZXIsIGwpOw0KICAgICAgZW5kZm9yDQogICAgICBub3Rp
    ZnkocGxheWVyLCAiLiIpOw0KICAgIGVuZGZvcg0KICBlbmRpZg0KZW5kZm9y
    DQpzdXNwZW5kKDApOw0KLg0KDQoNCg0KO2FkZF92ZXJiKHBsYXllciwge3Bs
    YXllciwgInJ4ZCIsICJfX2NyZWF0ZV9wcm9wcyJ9LCB7InRoaXMiLCAibm9u
    ZSIsICJ0aGlzIn0pDQoNCi5wcm9ncmFtIG1lOl9fY3JlYXRlX3Byb3BzDQoi
    Q3JlYXRlIGFsbCBwcm9wZXJ0aWVzIG9uIGRlZmluZWQgb24gcGFyZW50IG9i
    amVjdHMuIjsNCmZvciBpIGluIFswLi50b251bShtYXhfb2JqZWN0KCkpXQ0K
    ICBvID0gdG9vYmooaSk7DQogIGlmICh2YWxpZChvKSkNCiAgICBmb3IgcCBp
    biAocHJvcGVydGllcyhvKSkNCiAgICAgIHRpY2tzX2xlZnQoKSA8IDEwMDAg
    fHwgc2Vjb25kc19sZWZ0KCkgPT0gMSA/IHN1c3BlbmQoMCkgfCAiIjsNCiAg
    ICAgIHBpID0gdGhpczp0b2xpdGVyYWwocHJvcGVydHlfaW5mbyhvLCBwKSk7
    DQogICAgICBwdiA9IHRoaXM6dG9saXRlcmFsKG8uKHApKTsNCiAgICAgIG5v
    dGlmeShwbGF5ZXIsIHRvc3RyKCI7YWRkX3Byb3BlcnR5KCIsIG8sICIsICIs
    IHRoaXM6dG9saXRlcmFsKHApLCANCiAgICAgICAgICAgICAgICAgICAgICAg
    ICAgICIsICIsIHB2LCAiLCAiLCBwaSwgIikiKSk7DQogICAgZW5kZm9yDQog
    IGVuZGlmDQplbmRmb3INCnN1c3BlbmQoMCk7DQouDQoNCg0KDQo7YWRkX3Zl
    cmIocGxheWVyLCB7cGxheWVyLCAicnhkIiwgIl9fcGFyZW50X3Byb3BzIn0s
    IHsidGhpcyIsICJub25lIiwgInRoaXMifSkNCg0KLnByb2dyYW0gbWU6X19w
    YXJlbnRfcHJvcHMNCiJVcGRhdGUgYWxsIHByb3BlcnRpZXMgaW5oZXJpdGVk
    IGZyb20gcGFyZW50cy4gIGllLCBwcm9wZXJ0eV9pbmZvIGFzIHdlbGwgYXMi
    Ow0KInRoZSBwcm9wZXJ0eSBkYXRhIGl0c2VsZi4iOw0KZm9yIGkgaW4gWzAu
    LnRvbnVtKG1heF9vYmplY3QoKSldDQogIGN1cm9iaiA9IG8gPSB0b29iaihp
    KTsNCiAgaWYgKHZhbGlkKG8pKQ0KICAgIHdoaWxlICh2YWxpZChjdXJvYmog
    PSBwYXJlbnQoY3Vyb2JqKSkpDQogICAgICBmb3IgcCBpbiAocHJvcGVydGll
    cyhjdXJvYmopKQ0KICAgICAgICB0aWNrc19sZWZ0KCkgPCAxMDAwIHx8IHNl
    Y29uZHNfbGVmdCgpID09IDEgPyBzdXNwZW5kKDApIHwgIiI7DQogICAgICAg
    IHBuID0gdGhpczp0b2xpdGVyYWwocCk7DQogICAgICAgIHBpID0gdGhpczp0
    b2xpdGVyYWwocHJvcGVydHlfaW5mbyhvLCBwKSk7DQogICAgICAgIG5vdGlm
    eShwbGF5ZXIsIHRvc3RyKCI7c2V0X3Byb3BlcnR5X2luZm8oIiwgbywgIiwi
    LCBwbiwgIiwiLCBwaSwgIikiKSk7DQogICAgICAgIGlmICghaXNfY2xlYXJf
    cHJvcGVydHkobywgcCkpDQogICAgICAgICAgcHYgPSB0aGlzOnRvbGl0ZXJh
    bChvLihwKSk7DQogICAgICAgICAgbm90aWZ5KHBsYXllciwgdG9zdHIoIjsi
    LCBvLCAiLiIsIHAsICIgPSAiLCBwdikpOw0KICAgICAgICBlbmRpZg0KICAg
    ICAgZW5kZm9yDQogICAgZW5kd2hpbGUNCiAgZW5kaWYNCmVuZGZvcg0Kc3Vz
    cGVuZCgwKTsNCi4NCg0KDQoNCjthZGRfdmVyYihwbGF5ZXIsIHtwbGF5ZXIs
    ICJyeGQiLCAiX19yZWN5Y2xlX29ianMifSwgeyJ0aGlzIiwgIm5vbmUiLCAi
    dGhpcyJ9KQ0KDQoucHJvZ3JhbSBtZTpfX3JlY3ljbGVfb2Jqcw0KIlJlY3lj
    bGUgYW55IG1pc3Npbmcgb2JqZWN0cywgZXhjbHVkaW5nICMzIjsNCmZvciBp
    IGluIFswLi50b251bShtYXhfb2JqZWN0KCkpXQ0KICB0aWNrc19sZWZ0KCkg
    PCAxMDAwIHx8IHNlY29uZHNfbGVmdCgpID09IDEgPyBzdXNwZW5kKDApIHwg
    IiI7DQogIG8gPSB0b29iaihpKTsNCiAgaWYgKCF2YWxpZChvKSAmJiBvICE9
    ICMzKQ0KICAgIG5vdGlmeShwbGF5ZXIsIHRvc3RyKCI7cmVjeWNsZSgiLCBv
    LCAiKSIpKTsNCiAgZW5kaWYNCmVuZGZvcg0Kc3VzcGVuZCgwKTsNCi4NCg0K
    DQoNCjthZGRfdmVyYihwbGF5ZXIsIHtwbGF5ZXIsICJyeGQiLCAiX19maXhf
    b2JqXzMifSwgeyJ0aGlzIiwgIm5vbmUiLCAidGhpcyJ9KQ0KDQoucHJvZ3Jh
    bSBtZTpfX2ZpeF9vYmpfMw0KaWYgKCEjMy53aXphcmQpDQogIG5vdGlmeShw
    bGF5ZXIsICI7XCJZb3Ugc2hvdWxkIGNsZWFyIHRoZSAud2l6YXJkIGZsYWcg
    b2YgIzMuXCIiKTsNCmVuZGlmDQppZiAoISMzLnByb2dyYW1tZXIpDQogIG5v
    dGlmeShwbGF5ZXIsICI7XCJZb3Ugc2hvdWxkIGNsZWFyIHRoZSAucHJvZ3Jh
    bW1lciBmbGFnIG9mICMzLlwiIik7DQplbmRpZg0KaWYgKCFpc19wbGF5ZXIo
    IzMpKQ0KICBub3RpZnkocGxheWVyLCAiO1wiWW91IHNob3VsZCB0eXBlIDtz
    ZXRfcGxheWVyX2ZsYWcoIzMsIDApIGFzIHdlbGwuXCIiKTsNCmVuZGlmDQou
    DQo=

Follow-Ups:

- Re: Panic recovery of a database - eg, BatMOO

- From: Ian Macintosh <ian@iman.internet.co.nz>

- Prev: open network connections
- Next: Re: Panic recovery of a database - eg, BatMOO
- Index: MOO-cows
- Thread: MOO-cows

Home | Subject Index | Thread Index