Comments (6)
Well, I just checked code - carbonserver uses filepath.Walk
which is do not support symlink by design. In theory, it can be implemented, but can significantly affect code complexity and performance, I'm doubt that we will implement it in near future.
from go-carbon.
Hi @interfan7,
Could you please share your go-carbon.conf file and please provide details where exactly symlink located and where it's pointing to and what's files are located there (because it's not clear from description above).
For example, whisper files located in /var/lib/whisper, symlink is /var/lib/whisper/path, pointing to /var/lib/anotherwhisper, where's only *.wsp files located.
from go-carbon.
Would you mind to note what is the code complexity? Is it just the addition of this logic (kind of pseudo-code because I'm not a Go programmer) inside the walk:
if (file is symlink)
{
(realpath, error) = symlink_root = filepath.EvalSymlinks(file)
if (!error)
{
filepath.WalkDir(realpath, same_fn)
}
}
This whole logic could be wrapped under user-defined config flag for performance preference although I'd hope the added logic is negligible in performance versus the actual read of a Whisper file.
BTW according to the doc filepath.WalkDir is more efficient than filepath.Walk.
from go-carbon.
Hi @interfan7
I'm not considering myself as professional Go programmer, but code above is more complex than just simple filepath.Walk
, isn't it? :)
I just want to emphasize that we'll not use symlink in prod, hence we will probably not implement symlink support in go-carbon in the near future. Also, please note that we're talking about carbonserver here and all related machinery (trie/trigram indices etc), probably normal carbonlink still support symlinks. Not sure if it will help in your case, though.
PRs from community are always welcome and appreciated, of course.
from go-carbon.
BTW according to the doc filepath.WalkDir is more efficient than filepath.Walk.
Yes, but WalkDir loads dir content in memory, can be quite heavy for big directories.
from go-carbon.
My .02: if you are traversing symlinks you need to some way to workaround endless loops as well.
from go-carbon.
Related Issues (20)
- [Q] Kill signal for graceful stop by flushing to Whisper files? HOT 1
- [BUG] panic: runtime error: slice bounds out of range
- [Q] add more kind of metrics from prometheus api
- response does not respect aggregation function for request spanning multiple aggregation periods
- [BUG] v0.17.0 CPU usage problem HOT 4
- [Q]Flags do not work red hat 8 HOT 7
- [Q] Resizing compressed files? HOT 1
- [FR] Pluggable storage engines? HOT 3
- [FR] Disable logs for 404 errors
- [Q] Production ready and related to Graphite Project? HOT 3
- [Q] short statsd flush interval causes missing data in grafana dashboard
- [Q] How is this meant to be installed? HOT 1
- [Q] Packages for Debian Bookworm HOT 2
- [BUG] If set to "carbon" user+group instead default root, the service start is stuck and no informative logs. HOT 1
- [Q]Force Carbonlink request? HOT 10
- [BUG] CVE-2020-13949 HOT 4
- [BUG] OOM (out of memory) recurring every 8-9 days HOT 10
- [Q] Is "workers" effectively bound to "max-cpu"? HOT 3
- [Q]How to build local version in order to investigate? HOT 2
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 go-carbon.