Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A few more minor changes #2

Merged
merged 3 commits into from
Feb 26, 2015
Merged

A few more minor changes #2

merged 3 commits into from
Feb 26, 2015

Conversation

drawks
Copy link
Contributor

@drawks drawks commented Feb 26, 2015

  • updated .gitignore to not track _vendor/pkg
  • export GOPATH in Makefile

lomik added a commit that referenced this pull request Feb 26, 2015
A few more minor changes
@lomik lomik merged commit 0ab4ee3 into go-graphite:master Feb 26, 2015
bom-d-van added a commit that referenced this pull request Jan 12, 2022
There are two bugs fixed in this commit:
  1. Empty directories not properly renewed during indexing (and could be
     trimmed at every two file list scans).
     During insert, trie.insert failed to bump up trie nodes properly if it's
     inserting directory. This means that if the directory being inserted is
     empty and already exists in the trie tree, when concurrent index is
     enabled, the directory nodes might be pruned and then re-inserted in the
     next file list scan. And then on and on. This issue it self is not a
     serious concern if bug #2 below doesn't exist.

  2. Query logics do not handle well for empty directories.
     The symptoms are that if the trie index tree contains empty directories,
     and if a query happens to matching it, it would causes the query state
     stack (matchers) jump to the wrong index, and lead to incorrect matches of
     the metrics.

Context:

On our Graphite production, for cleanup purpose, we have daily cron jobs
removing stale graphite metric files and empty directories in the whisper tree.
The cronjob that removes files is run at 5AM and empty directory removal at 7AM.
This means the above bugs have a time window of 1-2 hours being triggered. And
because empty directories are not handled properly due to bug #1, the issue is
triggered every 2 file list scans. Essentially, if the query matched an empty
directory node and there are other metrics listed after the empty directory path,
trie query can't return proper result. In our case, it's returning missing
results, in theory, it could also return incorrect results.

In theory, these fixes are not needed because we stop indexing empty directory
nodes in commit 67446d3. But it's nice to figure
out the root cause and resolve the issue properly!

Took me almost a week to figure it out! But I'm happy. Tears in rain.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants