[ 
https://issues.apache.org/jira/browse/DERBY-5232?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Mamta A. Satoor updated DERBY-5232:
-----------------------------------

    Attachment: DERBY5232_patch4_stat.txt
                DERBY5232_patch4_diff.txt

Here is another patch(DERBY5232_patch4_diff.txt) which is ready for commit. 
Some of the changes going in this patch are as follows. If there are no further 
comments, I will go ahead and commit it next week. As the next step, I will 
look at creating these readme files at the time of upgrade. Next step can be 
having these readme files either backed up at backup time and then restore 
them, or (re)create them at the restore time whether on not they were part of 
the backup process.

1)Three readme files(README_DONT_TOUCH_FILES.txt) will be created. One at the 
database level, one in the "log" directory and another in the "seg0" directory.
a)Content of the readme file at the database level are as follows
# *************************************************************************
# ***              Do not touch files in this directory!                ***
# *** FILES IN THIS DIRECTORY AND SUB-DIRECTORIES CONSTITUES DERBY      ***
# *** DATABASE WHICH INCLUDES THE DATA(USER AND SYSTEM) AND THE         ***
# *** NECESSARY FILES FOR DATABASE RECOVERY.                            ***
# *** EDITING, ADDITING OR DELETING ANY OF THESE FILES MAY CAUSE DATA   ***
# *** CORRUPTION AND LEAVE THE DATABASE IN NON-RECOVERABLE STATE.       ***
# *************************************************************************
b)Content of the readme file at "seg0" directory are as follows
# *************************************************************************
# ***              Do not touch files in this directory!                ***
# *** FILES IN THIS DIRECTORY ARE USED BY THE DERBY DATABASE TO STORE   *** 
# *** USER AND SYSTEM DATA. EDITING, ADDING, OR DELETING FILES IN THIS  ***
# *** DIRECTORY WILL CORRUPT THE ASSOCIATED DERBY DATABASE, AND WILL    ***
# *** NOT BE RECOVERABLE.                                               ***
# *************************************************************************
c)Content of the readme file at "log" directory are as follows
# *************************************************************************
# ***              Do not touch files in this directory!                ***
# *** FILES IN THIS DIRECTORY ARE USED BY THE DERBY DATABASE RECOVERY   ***
# *** SYSTEM. EDITING, ADDING OR DELETING FILES IN THIS DIRECTORY WILL  ***
# *** CAUSE THE DERBY RECOVERY SYSTEM TO FAIL LEADING TO UNRECOVERABLE  ***
# *** CORRUPT DATABASES.                                                ***
# *************************************************************************
2)I have replaced all the tabs with spaces and looked at the diff and it seems 
consistent with indentation. Please let me know if I have missed anything.
3)I went ahead with duplicating the readme writing code in 3 places rather than 
adding a new method to StorageFactory.java interface because that puts the 
burden of implementing that method on atleast 5 classes right now which 
implement StorageFactory interface. Please let me know if the code duplication 
should be handled differntly.


Kathey, you had good suggestion about pointing out attention to ,lck and 
service.properties and permission issues with multiple users in the log file. I 
can't recall offhand but if this is mentioned in some central place in our doc, 
but if it is, then maybe we can have a blurb in the 3 readme files to go that 
section of the doc to get more information about the files in the database 
directories.

Knut, I have used writeUTF api to write into the 3 readme files. Can you please 
try this patch on your machine and see if you are able to view them with less 
now that they are in UTF-8 format?


                
> Put a stern README file in log and seg0 directories to warn users of 
> corrpution they will cause if they touch files there
> -------------------------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-5232
>                 URL: https://issues.apache.org/jira/browse/DERBY-5232
>             Project: Derby
>          Issue Type: Improvement
>          Components: Store
>    Affects Versions: 10.8.1.2
>            Reporter: Kathey Marsden
>            Assignee: Mamta A. Satoor
>         Attachments: DERBY5232_patch1_diff.txt, DERBY5232_patch1_stat.txt, 
> DERBY5232_patch2_diff.txt, DERBY5232_patch2_stat.txt, 
> DERBY5232_patch3_diff.txt, DERBY5232_patch3_stat.txt, 
> DERBY5232_patch4_diff.txt, DERBY5232_patch4_stat.txt
>
>
> Users often on bad advice or desperation  touch or delete files in the log or 
> seg0 directories (mostly log).
> I think it would be good for new databases and on upgrade that a file be 
> created in these directories with a name like:
> TOUCHING_FILES_HERE_WILL_CORRUPT_DB_README.txt
> or some such to warn of the perils of doing this and the corrupting effects 
> and how it can eliminate any possibility of salvage. It should also encourage 
> users to make a zip backup of the database directory with no jvm currently 
> accessing it before trying to do anything with the database if it appears to 
> be already corrupt.  Also point to backup/restore documentation and encourage 
> restore of a good backup into an empty directory if the database is corrupt.
> I'm not sure if it would help but it couldn't hurt.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to