Skip to contentSkip to conversation

Data loss during power off

DISCUSSION Henrique Faria 4 participants 8 messages Jun 26, 2002 – Jun 27, 2002

lore
Share & tools
lore
#0 lore raw

Does changing JOURNAL_MAX_TRANS_AGE and JOURNAL_MAX_COMMIT_AGE values make any sense? Well, at least, it seemed to.
I read something about Reiser4 APIs to handle transactions, in the reiser FAQs (question 47). Nikita Danilov wrote some words mentioning this feature. I wonder if it could solve my problems.
By the way, when reiser4 will be available?
Thank you all,

Henrique R. Faria

On Wed, 26 Jun 2002 09:08:29 +0400, Oleg Drokin <[email protected]> escreveu :

Quoted 10 lines

De: Oleg Drokin <[email protected]>
Data: Wed, 26 Jun 2002 09:08:29 +0400
Para: Henrique Faria <[email protected]>
Assunto: Re: [reiserfs-list] Data loss during power off

Hello!

This (almost) cannot be done. Of course you may resort to opening files with O_SYNC or issuing sync/fsync calls after each write, this way you'd lose even less data by the cost of speed of fs

operations.

Quoted 1 line

At least with this approach you may be sure that after sync/fsync

returned

Quoted 9 lines

(or write in case of oepning with O_SYNC), data are safe on the media. (This is assuming that your flash memory card does not do any cheating
and does not report it have completed command before actual writing).

Bye,
Oleg

Quoted 2 lines · Henrique Faria

Hello!
We're using reiserfs 3.6.25 and linux 2.4.18, in a 256 MB flash memory

card,

Quoted 1 line
Quoted 1 line

to develop a game. Data is written all the time, in local files, by the

main

Quoted 3 lines
Quoted 3 lines

process. The "power off" test has to be done, for the machines will be turned off with no shutdown process.
What's happening: pressing the power off button (during data writing)

makes

Quoted 1 line
Quoted 1 line

data to be lost. Is it possible to force the data to be written in the

file

Quoted 2 lines
Quoted 2 lines

system? I tried to change the JOURNAL_MAX_TRANS_AGE and the JOURNAL_MAX_COMMIT_AGE consts. Less data is lost, but I still get some

loss.

Quoted 6 lines
Quoted 3 lines

Thanks,

Henrique R. Faria

#1 lore raw
Quoted 6 lines · Henrique Faria

Does changing JOURNAL_MAX_TRANS_AGE and JOURNAL_MAX_COMMIT_AGE values make any sense? Well, at least, it seemed to.
I read something about Reiser4 APIs to handle transactions, in the reiser FAQs (question 47). Nikita Danilov wrote some words mentioning this feature. I wonder if it could solve my problems.
By the way, when reiser4 will be available?

See http://www.namesys.com:

Reiser4 is due 30 Sept. 2001.

Quoted 48 lines

Thank you all,

Henrique R. Faria

On Wed, 26 Jun 2002 09:08:29 +0400, Oleg Drokin <[email protected]> escreveu :

Quoted 10 lines

De: Oleg Drokin <[email protected]>
Data: Wed, 26 Jun 2002 09:08:29 +0400
Para: Henrique Faria <[email protected]>
Assunto: Re: [reiserfs-list] Data loss during power off

Hello!

This (almost) cannot be done. Of course you may resort to opening files with O_SYNC or issuing sync/fsync calls after each write, this way you'd lose even less data by the cost of speed of fs

operations.

Quoted 1 line

At least with this approach you may be sure that after sync/fsync

returned

Quoted 9 lines

(or write in case of oepning with O_SYNC), data are safe on the media. (This is assuming that your flash memory card does not do any cheating
and does not report it have completed command before actual writing).

Bye,
Oleg

Quoted 2 lines · Henrique Faria

Hello!
We're using reiserfs 3.6.25 and linux 2.4.18, in a 256 MB flash memory

card,

Quoted 1 line
Quoted 1 line

to develop a game. Data is written all the time, in local files, by the

main

Quoted 3 lines
Quoted 3 lines

process. The "power off" test has to be done, for the machines will be turned off with no shutdown process.
What's happening: pressing the power off button (during data writing)

makes

Quoted 1 line
Quoted 1 line

data to be lost. Is it possible to force the data to be written in the

file

Quoted 2 lines
Quoted 2 lines

system? I tried to change the JOURNAL_MAX_TRANS_AGE and the JOURNAL_MAX_COMMIT_AGE consts. Less data is lost, but I still get some

loss.

Quoted 6 lines
Quoted 3 lines

Thanks,

Henrique R. Faria

#2 lore raw

On Thu, 27 Jun 2002 12:01:54 +0400
Nikita Danilov <[email protected]> wrote:

  |   > By the way, when reiser4 will be available?
  |  
  |  See http://www.namesys.com:
  |  
  |  Reiser4 is due 30 Sept. 2001.
  |  

<grin>
Well, too bad it's been out since almost a year and nobody knew about ;o)) </grin>

Still, i'll definitely look for 30 Sept. 2002 :o)

Cheers,

Philippe

#3 lore raw
Quoted 10 lines · Philippe Gramoullé

On Thu, 27 Jun 2002 12:01:54 +0400
Nikita Danilov <[email protected]> wrote:

  |   > By the way, when reiser4 will be available?
  |  
  |  See http://www.namesys.com:
  |  
  |  Reiser4 is due 30 Sept. 2001.
  |  
Quoted 3 lines

<grin>
Well, too bad it's been out since almost a year and nobody knew about ;o)) </grin>

I have done too much debugging recently, it seems...

Quoted 7 lines

Still, i'll definitely look for 30 Sept. 2002 :o)

Cheers,

Philippe

Nikita.

#4 lore raw
In reply to Nikita Danilov

Nikita,

I did not find any download link to Reiser4 in the site at all. Thanks,

Henrique

On Thu, 27 Jun 2002 12:01:54 +0400, Nikita Danilov <[email protected]> escreveu :

Quoted 7 lines

De: Nikita Danilov <[email protected]>
Data: Thu, 27 Jun 2002 12:01:54 +0400
Para: "Henrique Faria" <[email protected]>
Assunto: Re: [reiserfs-list] Data loss during power off

Quoted 1 line · Henrique Faria

Does changing JOURNAL_MAX_TRANS_AGE and JOURNAL_MAX_COMMIT_AGE values

make

Quoted 2 lines
Quoted 2 lines

any sense? Well, at least, it seemed to.
I read something about Reiser4 APIs to handle transactions, in the

reiser

Quoted 1 line
Quoted 1 line

FAQs (question 47). Nikita Danilov wrote some words mentioning this

feature.

Quoted 12 lines
Quoted 2 lines

I wonder if it could solve my problems.
By the way, when reiser4 will be available?

See http://www.namesys.com:

Reiser4 is due 30 Sept. 2001.

Quoted 5 lines

Thank you all,

Henrique R. Faria

On Wed, 26 Jun 2002 09:08:29 +0400, Oleg Drokin <[email protected]>

escreveu

Quoted 11 lines
Quoted 11 lines

:

Quoted 9 lines

De: Oleg Drokin <[email protected]>
Data: Wed, 26 Jun 2002 09:08:29 +0400
Para: Henrique Faria <[email protected]>
Assunto: Re: [reiserfs-list] Data loss during power off

Hello!

This (almost) cannot be done. Of course you may resort to opening files with O_SYNC or issuing sync/fsync calls after each

write,

Quoted 5 lines
Quoted 5 lines
Quoted 1 line

this way you'd lose even less data by the cost of speed of fs

operations.

Quoted 1 line

At least with this approach you may be sure that after sync/fsync

returned

Quoted 1 line

(or write in case of oepning with O_SYNC), data are safe on the

media.

Quoted 1 line
Quoted 1 line
Quoted 1 line

(This is assuming that your flash memory card does not do any

cheating

Quoted 1 line
Quoted 1 line
Quoted 1 line

and does not report it have completed command before actual

writing).

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines

Bye,
Oleg

Quoted 2 lines · Henrique Faria

Hello!
We're using reiserfs 3.6.25 and linux 2.4.18, in a 256 MB flash

memory

Quoted 2 lines
Quoted 2 lines

card,

Quoted 1 line
Quoted 1 line

to develop a game. Data is written all the time, in local files, by

the

Quoted 2 lines
Quoted 2 lines

main

Quoted 1 line
Quoted 1 line

process. The "power off" test has to be done, for the machines will

be

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

turned off with no shutdown process.
What's happening: pressing the power off button (during data

writing)

Quoted 2 lines
Quoted 2 lines

makes

Quoted 1 line
Quoted 1 line

data to be lost. Is it possible to force the data to be written in

the

Quoted 3 lines
Quoted 3 lines

file

Quoted 2 lines
Quoted 2 lines

system? I tried to change the JOURNAL_MAX_TRANS_AGE and the JOURNAL_MAX_COMMIT_AGE consts. Less data is lost, but I still get

some

Quoted 11 lines
Quoted 8 lines

loss.

Quoted 6 lines
Quoted 3 lines

Thanks,

Henrique R. Faria

#5 lore raw
Quoted 4 lines · Henrique Faria

Nikita,

I did not find any download link to Reiser4 in the site at all. Thanks,

Sorry, I meant "30 Sept. 2002", of course. Or is it "31 Dec. 2002"?

Anyway, wait a bit. :)

Quoted 69 lines

Henrique

On Thu, 27 Jun 2002 12:01:54 +0400, Nikita Danilov <[email protected]> escreveu :

Quoted 7 lines

De: Nikita Danilov <[email protected]>
Data: Thu, 27 Jun 2002 12:01:54 +0400
Para: "Henrique Faria" <[email protected]>
Assunto: Re: [reiserfs-list] Data loss during power off

Quoted 1 line · Henrique Faria

Does changing JOURNAL_MAX_TRANS_AGE and JOURNAL_MAX_COMMIT_AGE values

make

Quoted 2 lines
Quoted 2 lines

any sense? Well, at least, it seemed to.
I read something about Reiser4 APIs to handle transactions, in the

reiser

Quoted 1 line
Quoted 1 line

FAQs (question 47). Nikita Danilov wrote some words mentioning this

feature.

Quoted 12 lines
Quoted 2 lines

I wonder if it could solve my problems.
By the way, when reiser4 will be available?

See http://www.namesys.com:

Reiser4 is due 30 Sept. 2001.

Quoted 5 lines

Thank you all,

Henrique R. Faria

On Wed, 26 Jun 2002 09:08:29 +0400, Oleg Drokin <[email protected]>

escreveu

Quoted 11 lines
Quoted 11 lines

:

Quoted 9 lines

De: Oleg Drokin <[email protected]>
Data: Wed, 26 Jun 2002 09:08:29 +0400
Para: Henrique Faria <[email protected]>
Assunto: Re: [reiserfs-list] Data loss during power off

Hello!

This (almost) cannot be done. Of course you may resort to opening files with O_SYNC or issuing sync/fsync calls after each

write,

Quoted 5 lines
Quoted 5 lines
Quoted 1 line

this way you'd lose even less data by the cost of speed of fs

operations.

Quoted 1 line

At least with this approach you may be sure that after sync/fsync

returned

Quoted 1 line

(or write in case of oepning with O_SYNC), data are safe on the

media.

Quoted 1 line
Quoted 1 line
Quoted 1 line

(This is assuming that your flash memory card does not do any

cheating

Quoted 1 line
Quoted 1 line
Quoted 1 line

and does not report it have completed command before actual

writing).

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines

Bye,
Oleg

Quoted 2 lines · Henrique Faria

Hello!
We're using reiserfs 3.6.25 and linux 2.4.18, in a 256 MB flash

memory

Quoted 2 lines
Quoted 2 lines

card,

Quoted 1 line
Quoted 1 line

to develop a game. Data is written all the time, in local files, by

the

Quoted 2 lines
Quoted 2 lines

main

Quoted 1 line
Quoted 1 line

process. The "power off" test has to be done, for the machines will

be

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

turned off with no shutdown process.
What's happening: pressing the power off button (during data

Quoted 16 lines

writing)

Quoted 2 lines
Quoted 2 lines

makes

Quoted 1 line
Quoted 1 line

data to be lost. Is it possible to force the data to be written in

the

Quoted 3 lines
Quoted 3 lines

file

Quoted 2 lines
Quoted 2 lines

system? I tried to change the JOURNAL_MAX_TRANS_AGE and the JOURNAL_MAX_COMMIT_AGE consts. Less data is lost, but I still get

some

Quoted 8 lines
Quoted 8 lines

loss.

Quoted 6 lines
Quoted 3 lines

Thanks,

Henrique R. Faria

Nikita.

Quoted 4 lines
Quoted 3 lines
#6 lore raw

Well, changing both JOURNAL_MAX_TRANS_AGE and JOURNAL_MAX_COMMIT_AGE to 0.1 and making the following configuration for flash devices

JOURNAL_BLOCK_COUNT 512
JOURNAL_TRANS_MAX 128
JOURNAL_MAX_BATCH 127

I was able to force data flush just after the file write C instructions (with O_SYNC or fsync). I did not get performance problems for while, maybe because it's a linux dedicated for a single game.

Thanks everybody,

Henrique R. Faria

On Thu, 27 Jun 2002 21:58:00 +0400, Nikita Danilov <[email protected]> escreveu :

Quoted 6 lines

De: Nikita Danilov <[email protected]>
Data: Thu, 27 Jun 2002 21:58:00 +0400
Para: "Henrique Faria" <[email protected]>
Assunto: Re: [reiserfs-list] Data loss during power off

Henrique Faria writes:

Quoted 22 lines
Quoted 4 lines

Nikita,

I did not find any download link to Reiser4 in the site at all. Thanks,

Sorry, I meant "30 Sept. 2002", of course. Or is it "31 Dec. 2002"?

Anyway, wait a bit. :)

Quoted 13 lines

Henrique

On Thu, 27 Jun 2002 12:01:54 +0400, Nikita Danilov <[email protected]> escreveu :

Quoted 7 lines

De: Nikita Danilov <[email protected]>
Data: Thu, 27 Jun 2002 12:01:54 +0400
Para: "Henrique Faria" <[email protected]>
Assunto: Re: [reiserfs-list] Data loss during power off

Quoted 1 line · Henrique Faria

Does changing JOURNAL_MAX_TRANS_AGE and JOURNAL_MAX_COMMIT_AGE

values

Quoted 5 lines
Quoted 5 lines

make

Quoted 2 lines
Quoted 2 lines

any sense? Well, at least, it seemed to.
I read something about Reiser4 APIs to handle transactions, in the

reiser

Quoted 1 line
Quoted 1 line

FAQs (question 47). Nikita Danilov wrote some words mentioning

this

Quoted 6 lines
Quoted 6 lines

feature.

Quoted 5 lines
Quoted 2 lines

I wonder if it could solve my problems.
By the way, when reiser4 will be available?

See http://www.namesys.com:

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

Reiser4 is due 30 Sept. 2001.

Quoted 5 lines

Thank you all,

Henrique R. Faria

On Wed, 26 Jun 2002 09:08:29 +0400, Oleg Drokin

<[email protected]>

Quoted 8 lines
Quoted 8 lines

escreveu

Quoted 7 lines
Quoted 7 lines

:

Quoted 5 lines

De: Oleg Drokin <[email protected]>
Data: Wed, 26 Jun 2002 09:08:29 +0400
Para: Henrique Faria <[email protected]>
Assunto: Re: [reiserfs-list] Data loss during power off

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

Hello!

This (almost) cannot be done. Of course you may resort to opening files with O_SYNC or issuing sync/fsync calls after

each

Quoted 4 lines
Quoted 4 lines

write,

Quoted 3 lines
Quoted 3 lines
Quoted 1 line

this way you'd lose even less data by the cost of speed of fs

operations.

Quoted 1 line

At least with this approach you may be sure that after

sync/fsync

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

returned

Quoted 1 line

(or write in case of oepning with O_SYNC), data are safe on

the

Quoted 11 lines
Quoted 11 lines

media.

Quoted 1 line
Quoted 1 line
Quoted 1 line

(This is assuming that your flash memory card does not do any

cheating

Quoted 1 line
Quoted 1 line
Quoted 1 line

and does not report it have completed command before actual

writing).

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines

Bye,
Oleg

Quoted 2 lines · Henrique Faria

Hello!
We're using reiserfs 3.6.25 and linux 2.4.18, in a 256 MB

flash

Quoted 3 lines
Quoted 3 lines

memory

Quoted 2 lines
Quoted 2 lines

card,

Quoted 1 line
Quoted 1 line

to develop a game. Data is written all the time, in local

files, by

Quoted 3 lines
Quoted 3 lines

the

Quoted 2 lines
Quoted 2 lines

main

Quoted 1 line
Quoted 1 line

process. The "power off" test has to be done, for the machines

will

Quoted 6 lines
Quoted 6 lines

be

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

turned off with no shutdown process.
What's happening: pressing the power off button (during data

writing)

Quoted 2 lines
Quoted 2 lines

makes

Quoted 1 line
Quoted 1 line

data to be lost. Is it possible to force the data to be

written in

Quoted 4 lines
Quoted 4 lines

the

Quoted 3 lines
Quoted 3 lines

file

Quoted 2 lines
Quoted 2 lines

system? I tried to change the JOURNAL_MAX_TRANS_AGE and the JOURNAL_MAX_COMMIT_AGE consts. Less data is lost, but I still

get

Quoted 19 lines
Quoted 9 lines

some

Quoted 8 lines
Quoted 8 lines

loss.

Quoted 6 lines
Quoted 3 lines

Thanks,

Henrique R. Faria

Nikita.

Quoted 4 lines
Quoted 3 lines
#7 lore raw
Quoted 11 lines · Henrique Faria

Well, changing both JOURNAL_MAX_TRANS_AGE and JOURNAL_MAX_COMMIT_AGE to 0.1 and making the following configuration for flash devices

JOURNAL_BLOCK_COUNT 512
JOURNAL_TRANS_MAX 128
JOURNAL_MAX_BATCH 127

I was able to force data flush just after the file write C instructions (with O_SYNC or fsync). I did not get performance problems for while, maybe because it's a linux dedicated for a single game.

All of the journal parameters should be ints. Setting them to 0.1 won't have quite the desired effect.

If you have JOURNAL_MAX_BATCH set to 1, you can ignore JOURNAL.*AGE, and the transaction will commit after each write.

-chris