Re: [PATCH v3 14/21] read-cache: touch shared index files when used

2017-01-31 Thread Junio C Hamano
Junio C Hamano writes: > Yes, but you need to realize that "it is better not to bother users > with a report of failure to touch in read-only repository" and "we > ignore all failures". Sorry about an unfinished sentence here. "need to realize that ... and ... are different things." > ... It i

Re: [PATCH v3 14/21] read-cache: touch shared index files when used

2017-01-31 Thread Junio C Hamano
Christian Couder writes: >> You are listing only the irrelevant cases. The shared one may be >> used immediately, and the user can keep using it for a while without >> "touching". > > Now you are talking about a case where the shared index file can be > used immediately and the user can keep usi

Re: [PATCH v3 14/21] read-cache: touch shared index files when used

2017-01-31 Thread Christian Couder
On Wed, Jan 25, 2017 at 9:52 PM, Junio C Hamano wrote: > Christian Couder writes: > >> Well, when we cannot freshen a loose file (with >> freshen_loose_object()), we don't warn or die, we just write the loose >> file. But here we cannot write the shared index file. > > I think that is an excellen

Re: [PATCH v3 14/21] read-cache: touch shared index files when used

2017-01-25 Thread Junio C Hamano
Christian Couder writes: > Well, when we cannot freshen a loose file (with > freshen_loose_object()), we don't warn or die, we just write the loose > file. But here we cannot write the shared index file. I think that is an excellent point. Let me make sure I got you right. For loose object fil

Re: [PATCH v3 14/21] read-cache: touch shared index files when used

2017-01-25 Thread Christian Couder
On Mon, Jan 23, 2017 at 7:53 PM, Junio C Hamano wrote: > Christian Couder writes: > >> Also in general the split-index mode is useful when you often write >> new indexes, and in this case shared index files that are used will >> often be freshened, so the risk of deleting interesting shared index

Re: [PATCH v3 14/21] read-cache: touch shared index files when used

2017-01-23 Thread Junio C Hamano
Christian Couder writes: > Also in general the split-index mode is useful when you often write > new indexes, and in this case shared index files that are used will > often be freshened, so the risk of deleting interesting shared index > files should be low. > ... >> Not that I think freshening w

Re: [PATCH v3 14/21] read-cache: touch shared index files when used

2017-01-23 Thread Christian Couder
On Thu, Jan 19, 2017 at 8:00 PM, Junio C Hamano wrote: > Duy Nguyen writes: > >> On Mon, Jan 9, 2017 at 9:34 PM, Junio C Hamano wrote: >>> Duy Nguyen writes: >>> On Sun, Jan 8, 2017 at 4:46 AM, Junio C Hamano wrote: > Christian Couder writes: > >> So what should we do if fres

Re: [PATCH v3 14/21] read-cache: touch shared index files when used

2017-01-20 Thread Duy Nguyen
On Fri, Jan 20, 2017 at 2:00 AM, Junio C Hamano wrote: > Duy Nguyen writes: > >> On Mon, Jan 9, 2017 at 9:34 PM, Junio C Hamano wrote: >>> Duy Nguyen writes: >>> On Sun, Jan 8, 2017 at 4:46 AM, Junio C Hamano wrote: > Christian Couder writes: > >> So what should we do if fres

Re: [PATCH v3 14/21] read-cache: touch shared index files when used

2017-01-19 Thread Junio C Hamano
Duy Nguyen writes: > On Mon, Jan 9, 2017 at 9:34 PM, Junio C Hamano wrote: >> Duy Nguyen writes: >> >>> On Sun, Jan 8, 2017 at 4:46 AM, Junio C Hamano wrote: Christian Couder writes: > So what should we do if freshen_file() returns 0 which means that the > freshening failed?

Re: [PATCH v3 14/21] read-cache: touch shared index files when used

2017-01-19 Thread Duy Nguyen
On Mon, Jan 9, 2017 at 9:34 PM, Junio C Hamano wrote: > Duy Nguyen writes: > >> On Sun, Jan 8, 2017 at 4:46 AM, Junio C Hamano wrote: >>> Christian Couder writes: >>> So what should we do if freshen_file() returns 0 which means that the freshening failed? >>> >>> You tell me ;-) as y

Re: [PATCH v3 14/21] read-cache: touch shared index files when used

2017-01-09 Thread Junio C Hamano
Duy Nguyen writes: > On Sun, Jan 8, 2017 at 4:46 AM, Junio C Hamano wrote: >> Christian Couder writes: >> >>> So what should we do if freshen_file() returns 0 which means that the >>> freshening failed? >> >> You tell me ;-) as you are the one who is proposing this feature. > > My answer is, w

Re: [PATCH v3 14/21] read-cache: touch shared index files when used

2017-01-09 Thread Duy Nguyen
On Sun, Jan 8, 2017 at 4:46 AM, Junio C Hamano wrote: > Christian Couder writes: > >> So what should we do if freshen_file() returns 0 which means that the >> freshening failed? > > You tell me ;-) as you are the one who is proposing this feature. My answer is, we are not worse than freshening

Re: [PATCH v3 14/21] read-cache: touch shared index files when used

2017-01-07 Thread Junio C Hamano
Christian Couder writes: > So what should we do if freshen_file() returns 0 which means that the > freshening failed? You tell me ;-) as you are the one who is proposing this feature. Isn't a failure to freshen it a grave error? We are letting a base/shared index file that is known to be in-u

Re: [PATCH v3 14/21] read-cache: touch shared index files when used

2017-01-02 Thread Christian Couder
On Tue, Dec 27, 2016 at 8:10 PM, Junio C Hamano wrote: > Christian Couder writes: > >> +/* >> + * Signal that the shared index is used by updating its mtime. >> + * >> + * This way, shared index can be removed if they have not been used >> + * for some time. It's ok to fail to update the mtime if

Re: [PATCH v3 14/21] read-cache: touch shared index files when used

2016-12-27 Thread Junio C Hamano
Christian Couder writes: > +/* > + * Signal that the shared index is used by updating its mtime. > + * > + * This way, shared index can be removed if they have not been used > + * for some time. It's ok to fail to update the mtime if we are on a > + * read only file system. > + */ > +void freshen

[PATCH v3 14/21] read-cache: touch shared index files when used

2016-12-26 Thread Christian Couder
When a split-index file is created, let's update the mtime of the shared index file that the split-index file is referencing. In a following commit we will make shared index file expire depending on their mtime, so updating the mtime makes sure that the shared index file will not be deleted soon.