Comments (7)
Could you please talk through an example as I'm not sure what you mean.
from tmsu.
Sure! Suppose you store your files on Dropbox/git-annex/etc. You probably want to do so for the TMSU database as well. This is possible, as long as one makes damn sure not to use TMSU on two clients at the same time; otherwise the files will diverge, and (depending on your sync solution), you wind up with two conflicting copies of the DB file. What would be nice, though, is if TMSU had a facility that could merge the diverged databases back into one coherent set.
If there are only additions, a coherent set might be constructed by going through file IDs and constructing the union of tags. The problem is that one client might delete a tag. And the only way of knowing if a tag was deleted is when you have the common, base version of the file from whence the two copies came. So I guess, given the complexity of it, this feature won’t be too enticing to you because probably only git-annex would be able to support it (because it gives you the base version of the file).
It’s more of a luxury problem, I guess :) … Keeping my data spread out over lots of git-annex clients, I would finde it awesome, but most people can probably deal with making sure never to run tmsu on more than one machine at a time.
from tmsu.
OK thanks for the detail.
Firstly I imagined users would store the database with the files such that the database is always in sync with the files. I suppose that's not always viable though.
I'll keep this open as it's a valid point: but it might be some time before I come to look at it.
from tmsu.
For the time being, isn't this something that can be implemented by a journalling wrapper?
It seems to me it could be very simple:
- use the wrapper instead of TMSU directly
- The wrapper calls tmsu with all the commandline arguments it was provided
- If the return status is normal, then it records the full TMSU command that it executed in a shell-script format 'journal' (keeping in mind the need to properly quote all arguments in case they have spaces or other special characters), along with the current working directory -- eg
cd "/home/me/files"; tmsu tag "music4.mp3" "metal"
- if the return status is not normal, it does not record the command.
I am imagining the process of 'merging' as simply executing the journal file, then, if its return status is normal, truncating the journal file to 0 bytes.
This is pretty much "the simplest thing that could possibly work", but it seems robust for all normal operation of TMSU.
The only potential gotcha I've noted is that the current working directory may be different on different machines, for example because of differing usernames. A solution that would address many cases including most Dropbox-related uses, is to substitute the user's current home directory with "$HOME" in the journalled cd commands (as in cd "$HOME/files"; tmsu tag "music4.mp3" "metal"
).
HTH,FWIW.
from tmsu.
I like the simplicity of the idea; the problem tough, is that with a journal, there comes a point when you need to commit the journal to the data store. And at this point, the original problem reappears, namely that you can’t atomically “lock” the database between different clients; as such the files can still diverge, and would require a three-way-merge after all.
from tmsu.
Well, yes; the only way to get rid of that problem 100% is for TMSU to communicate with the other machines when performing operations (which, TBH, seems way out of its scope). But automatically journaling and then automatically committing that journal, seems like it achieves the goal generally as long as you aren't tagging the exact same file differently within a minute on different machines. (which, given that you are only one person, seems like a reasonable assumption ;)
(journalling also has some advantages for conflict resolution that TMSU itself doesn't have and AFAICS cannot have -- eg. you can include timestamps to help resolve what tagging takes priority)
from tmsu.
I don't think this is going to happen any time soon.
from tmsu.
Related Issues (20)
- database locked occasionally
- VFS can be very slow
- Feature Request in VFS: Listing files outside of the `files` folder and hiding `queries` folder
- Cannot install TMSU HOT 1
- Package available in Void Linux
- too many SQL variables - transport endpoint is not connected when too many tag values exist
- Use unique indexes and upserts? HOT 1
- "tmsu init" ignores TMSU_DB environment variable
- release v0.8 HOT 2
- `tmsu tag -h` should be an alias for `tmsu help tag`
- `tmsu repair` should operate on the root or on `.` if no paths are given
- another app using the database? HOT 1
- how does 0 value_id work? HOT 1
- Tags attributes HOT 3
- Unit tests are shaky: Fingerprint incorrect
- `tmsu help repair` message contains a typo
- Compilation error
- Support hierarchical tags
- Ubuntu 24.04 LTS Installation Fails for Lack of Release file HOT 1
- Cannot generate thumbnails for symlinks HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tmsu.