Le 29/01/16 16:26, Kiran Ayyagari a écrit : > On Fri, Jan 29, 2016 at 8:40 PM, Emmanuel Lécharny <elecha...@gmail.com> > wrote: > >> Le 29/01/16 15:51, Zheng, Kai a écrit : >>>>> I'm most certainly overdoing : the first step is to start the server, >> which is all but a good idea. I have to simply read the configuration >> instead, because this is all what I need. >>> You mean it doesn't have to use or start a server to run the repair >> process, right. >> >> Right. We just need to know where to find the data, and which index are >> to be recreated. This is described in the configuration partition. We >> also have to know about the schema, thus be able to read it. >> >>> If so it sounds good, because purely running a repair tool against the >> database would be easy to use. Later it can also be a healthy check tool. >> >> Ideally, we should be able to start the server in repair mode. This is >> what we do when we define a new index : you don't have to create the >> index files, it's done at startup (actually, this is automatic, we see >> that an index table is missing, and we create it). >> >> That makes me thing that a repair mode would be much simpler than >> starting the server with a 'repair' parameter : it's enough to delete >> all the indexes, they will be recreated at startup !!! (Actually, t >> won't work simply because we recreate the user index, not the system >> indexes, but the idea is brillant : we just have to check the system >> index and rebuild them if missing... I'll do that this week-end !) >> > it is not easy for the server to detect a corrupted database, and > "deleting" index files > is a manual step which requires internal knowledge about the installation > directory > instead passing a -repair flag is much easier. > > Upon seeing the -repair flag the server can just delete the index files > before initializing > the partitions then the respective partitions can take care of re-building > the indices.
Right, right... Although I can improve the current process : instead of dealing with repair separately from starting the server, I can merge the thwo phases into one. That will still need the 'repair' parameter, but it will make the code simpler.