Return-Path: X-Original-To: apmail-db-derby-dev-archive@www.apache.org Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 31910D2CC for ; Tue, 23 Oct 2012 03:45:16 +0000 (UTC) Received: (qmail 30968 invoked by uid 500); 23 Oct 2012 03:45:16 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 30873 invoked by uid 500); 23 Oct 2012 03:45:15 -0000 Mailing-List: contact derby-dev-help@db.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: Delivered-To: mailing list derby-dev@db.apache.org Received: (qmail 30753 invoked by uid 99); 23 Oct 2012 03:45:12 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 23 Oct 2012 03:45:12 +0000 Date: Tue, 23 Oct 2012 03:45:12 +0000 (UTC) From: "Mamta A. Satoor (JIRA)" To: derby-dev@db.apache.org Message-ID: <2137837749.14505.1350963912949.JavaMail.jiratomcat@arcas> In-Reply-To: <1762881484.10674.1305308027375.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Updated] (DERBY-5232) Put a stern README file in log and seg0 directories to warn users of corrpution they will cause if they touch files there MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ 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_patch2_stat.txt DERBY5232_patch2_diff.txt I have another patch which has following changes compared to the first patch 1)It does not hard code the readme contents inside the java file. Instead, it uses existing mechanics to store that text inside messages.xml so it will get translated. 2)The code now handles StandardException as pointed out by Knut. 3)I have named the readme file as README_DONT_TOUCH_FILES.txt 4)I have been able to create README_DONT_TOUCH_FILES.txt at the top level(db level) and at log level. But I have not been able to find yet the place in the code to create a README_DONT_TOUCH_FILES.txt at seg level and will greatly appreciate help here. I thought the correct location for creating this file in the code will be in store.access.RAMAccessManager:boot() method right after xactProperties = new PropertyConglomerate(tc, create, startParams, pf); The above line creates seg0 directory and creates the first heap file in it. And it seems like, right after the seg0 directory is created, we should create the README_DONT_TOUCH_FILES.txt but to create a file, we need access to StorageFactory which has the new method newStorageFile() to create a new file and I do not know how to get hold of StorageFactory inside RAMAccessManager. It is possible that I am looking at wrong place for adding the code. Would appreciate help from someone more familiar with this part of the code. 5)Even though I have added the text is messages.xml with new lines, when it gets written into README_DONT_TOUCH_FILES.txt, I find that the newlines are lost and everything is added as one long line. I am not sure yet what I could be doing wrong. M005 # ************************************************************************* # *** Do not touch files in this directory! *** # *** CHANGING THE CONTENT OF THIS DIRECTORY MAY CAUSE DATA CORRUPTION. *** # ************************************************************************* Translators: Please translate the ALL CAPS words. I still need to add more comments but wanted to put the patch out for review and for help with couple items I haven't figured out yet. Thanks. > 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 > > > 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