Re: 回复: why my process open .svn/tmp/svn-XXXXXX file? and why aretmpfiles deleted? and why my process can't open the right file after tmpfiles deleted?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: 回复: why my process open .svn/tmp/svn-XXXXXX file? and why aretmpfiles deleted? and why my process can't open the right file after tmpfiles deleted?

Johan Corveleyn-3
Op 23 dec. 2017 04:19 schreef "Keva-Slient" <[hidden email]>:
thank you for your patience. my English is very poor.

No problem, we'll try to communicate as best as we can :-). But please use "reply all" to keep the users-list in cc, so others can help out as well ...



It's still not clear what online-assist is really doing. 
   online-assist is our process. it opens db files stored in working copy. it keep db files open for read and write. file handle it has is same as db connection.
   db file is managed by svn. stored in repository. not tmp file in .svn/tmp

What svn commands does it execute?
    in client sideeach repository only has one svn client user. the only one user of each repository only execute commit command. 
    in server side. we do svnadmin dump everyday to each repository

I don't understand why the deletes of the tmp files are a problem.  Are you trying to keep those tmp files open?? That would be bad. You should NOT depend on those tmp files.
      first of all, i  don't keep tmp files open. i keep config file versioned by svn open( i keep config file saved by svn repository open). regular file saved in repository.
      second, i keep the config file open. why has it been moved to tmp while i just only do commit command?(you had answered this)
      third,   why delete the tmp file while there is nothing different, nothing to merge, nothing conflict? can't svn move the tmp file back to repository?  if svn could move tmp file back to where it was in repository while there is nothing to do with repository, tmp file will not be a problem.
    
Or is the problem that you're keeping the WORKING files open (as

opposed to the tmp files corresponding to them), and you want to keep
them open even while you're committing them? And subversion replaces
those files from underneath you, when you're committing them?
       yes. we're keeping the WORKING files open. 
       why does committing make working file moved to tmp?can't svn copy working file to tmp and commit this tmp file? if svn can, it will not interrupt process. we only do committing for repository. 
       i think working file must be replaced  only it needs merge when updating.

A possible reason for SVN to replace your working file while when
you're committing it, is keyword-expansion [1]. If you have such
keywords in your source file, and you have the "svn:keywords" property
set on it, SVN really has to change your file when you're committing.
      i see you understand my question. i've explain a lot yet. LOL
      we don't set svn:keywords on.and the deleted file are binary type.
      
But maybe that "replace file" codepath is executed even when there are
no keywords present and the svn:keywords property is not set... That
might be fixable.
      yes. that's what we meet now.
   
OTOH, there might be other reasons why SVN needs to touch the file

when you're committing it (I haven't looked at the code).
      thank you very much. i'm trying to debug svn commit to see when svn commit would create tmp file.

------------------

Okay, I think with your input above I understand the problem ('svn commit' moving your working file to .svn/tmp and replacing it with a new file after commit, even when svn:keywords is not set). Unfortunately I don't know enough about the internals of 'commit' to know why this would be happening or whether it can be avoided. Maybe Bert or someone else on the list can help more.

-- 
Johan

Reply | Threaded
Open this post in threaded view
|

回复: 回复: why my process open .svn/tmp/svn-XXXXXX file? and why aretmpfiles deleted? and why my process can't open the right file after tmpfiles deleted?

Keva-Slient
hello, i've analysed svn commit command source code.  attachment is the result. 
the call stack of svn commit. 
there are three position calling svn_io_open_unique_file3 , which function creates tmp file.

can you give some guide, which could create tmp file of working copy?

------------------
.........
Vanity...My favourite sin.
    --<<The Devil's Advocate>>
 


------------------ 原始邮件 ------------------
发件人: "Johan Corveleyn";<[hidden email]>;
发送时间: 2017年12月23日(星期六) 晚上11:31
收件人: "Keva-Slient"<[hidden email]>;
抄送: "Subversion"<[hidden email]>; "Bert Huijben"<[hidden email]>;
主题: Re: 回复: why my process open .svn/tmp/svn-XXXXXX file? and why aretmpfiles deleted? and why my process can't open the right file after tmpfiles deleted?

Op 23 dec. 2017 04:19 schreef "Keva-Slient" <[hidden email]>:
thank you for your patience. my English is very poor.

No problem, we'll try to communicate as best as we can :-). But please use "reply all" to keep the users-list in cc, so others can help out as well ...



It's still not clear what online-assist is really doing. 
   online-assist is our process. it opens db files stored in working copy. it keep db files open for read and write. file handle it has is same as db connection.
   db file is managed by svn. stored in repository. not tmp file in .svn/tmp

What svn commands does it execute?
    in client sideeach repository only has one svn client user. the only one user of each repository only execute commit command. 
    in server side. we do svnadmin dump everyday to each repository

I don't understand why the deletes of the tmp files are a problem.  Are you trying to keep those tmp files open?? That would be bad. You should NOT depend on those tmp files.
      first of all, i  don't keep tmp files open. i keep config file versioned by svn open( i keep config file saved by svn repository open). regular file saved in repository.
      second, i keep the config file open. why has it been moved to tmp while i just only do commit command?(you had answered this)
      third,   why delete the tmp file while there is nothing different, nothing to merge, nothing conflict? can't svn move the tmp file back to repository?  if svn could move tmp file back to where it was in repository while there is nothing to do with repository, tmp file will not be a problem.
    
Or is the problem that you're keeping the WORKING files open (as

opposed to the tmp files corresponding to them), and you want to keep
them open even while you're committing them? And subversion replaces
those files from underneath you, when you're committing them?
       yes. we're keeping the WORKING files open. 
       why does committing make working file moved to tmp?can't svn copy working file to tmp and commit this tmp file? if svn can, it will not interrupt process. we only do committing for repository. 
       i think working file must be replaced  only it needs merge when updating.

A possible reason for SVN to replace your working file while when
you're committing it, is keyword-expansion [1]. If you have such
keywords in your source file, and you have the "svn:keywords" property
set on it, SVN really has to change your file when you're committing.
      i see you understand my question. i've explain a lot yet. LOL
      we don't set svn:keywords on.and the deleted file are binary type.
      
But maybe that "replace file" codepath is executed even when there are
no keywords present and the svn:keywords property is not set... That
might be fixable.
      yes. that's what we meet now.
   
OTOH, there might be other reasons why SVN needs to touch the file

when you're committing it (I haven't looked at the code).
      thank you very much. i'm trying to debug svn commit to see when svn commit would create tmp file.

------------------

Okay, I think with your input above I understand the problem ('svn commit' moving your working file to .svn/tmp and replacing it with a new file after commit, even when svn:keywords is not set). Unfortunately I don't know enough about the internals of 'commit' to know why this would be happening or whether it can be avoided. Maybe Bert or someone else on the list can help more.

-- 
Johan


svn-commit--analysed.png (28K) Download Attachment
svn-commit--call-stack.png (730K) Download Attachment