Project

General

Profile

Actions

Bug #1598

closed

undo hangs

Added by justin over 14 years ago. Updated over 14 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:

Description

I munged up a file, and wasn't able to retrieve the last version using
undo on a Hammer volume:

Do this on leaf:

undo -o local.css.old /usr/pkg/share/ikiwiki/basewiki/local.css

The process does not return:

root 23659 0.0 0.0 1552 628 0 IL+ 7:30PM 0:00.00 undo -o
local.css.old /usr/pkg/share/ikiwiki/basewiki/local.css

Not sure if I just missed something... I was able to retrieve the file
from a snapshot.

Actions #1

Updated by dillon over 14 years ago

:I munged up a file, and wasn't able to retrieve the last version using
:undo on a Hammer volume:
:
:Do this on leaf:
:
:undo -o local.css.old /usr/pkg/share/ikiwiki/basewiki/local.css
:
:The process does not return:
:
:root 23659 0.0 0.0 1552 628 0 IL+ 7:30PM 0:00.00 undo -o
:local.css.old /usr/pkg/share/ikiwiki/basewiki/local.css
:
:Not sure if I just missed something... I was able to retrieve the file
:from a snapshot.

It's kinda a bug in undo.  Basically undo is synthesizing ALL the
transaction ids ever used to update the file. But some of those
transaction ids bisect the directory entry and inode so the
directory entry might exist and the inode might not.
In the case where the inode does not exist HAMMER synthesizes a fake
one and unfortunately I chose the FIFO type (as in 'mkfifo' style) :-).
Bad choice on my fault. So undo winds up trying to open a FIFO and
of course hangs until you hit ^C since there is nobody on the other
side of the FIFO.
If someone would like a little mini project, just add a stat() or fstat()
call in the undo code and don't try to open() files that aren't regular
files. Plus generate a warning to stderr for that transaction id.
-Matt
Matthew Dillon
<>
Actions #2

Updated by polachok over 14 years ago

If someone would like a little mini project, just add a stat() or fstat()
call in the undo code and don't try to open() files that aren't regular
files. Plus generate a warning to stderr for that transaction id.

Ran into this bug today myself. Do you mean something like this [1]? I don't like
phrasing though.
[1] fetch http://leaf.dragonflybsd.org/~polachok/undo-patch-1.diff

Actions #3

Updated by dillon over 14 years ago

:Alexander Polakov <> added the comment:
:
:> If someone would like a little mini project, just add a stat() or fstat()
:> call in the undo code and don't try to open() files that aren't regular
:> files. Plus generate a warning to stderr for that transaction id.
:
:Ran into this bug today myself. Do you mean something like this [1]? I don'=
:t like=20
:phrasing though.
:[1] fetch http://leaf.dragonflybsd.org/~polachok/undo-patch-1.diff

Yup.  Fix it up so you like it and commit :-)
-Matt
Matthew Dillon
&lt;&gt;
Actions #4

Updated by Anonymous over 14 years ago

Does this still apply ?
I think Polachok committed a fix. Ok to close it ?

Actions

Also available in: Atom PDF