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

HH should not process dropped nodes #4377

Merged
merged 3 commits into from
Oct 9, 2015
Merged

HH should not process dropped nodes #4377

merged 3 commits into from
Oct 9, 2015

Conversation

otoolep
Copy link
Contributor

@otoolep otoolep commented Oct 8, 2015

No description provided.

@otoolep
Copy link
Contributor Author

otoolep commented Oct 8, 2015

@jwilder @corylanou

As for testing, I thought the simplest thing to do was to add the new code to the existing test. Yes, it means a somewhat longer test case, but it's very straightforward. This is the limit to which I would push it though.

@otoolep
Copy link
Contributor Author

otoolep commented Oct 8, 2015

Patch updated to remove the stubbed-out "purge" call. All data deletion is left to simple expiration so that data is never dropped directly due to operations such as DROP SERVER.

@otoolep
Copy link
Contributor Author

otoolep commented Oct 8, 2015

I see that with this change, the system will continually be adding a new segment for all queues it purges. That is not what I wanted. Let me fix this up.

@otoolep otoolep force-pushed the dropped_server_hh branch 3 times, most recently from adc021d to d47521f Compare October 9, 2015 01:09
@@ -273,6 +281,20 @@ func (p *Processor) updateShardStats(shardID uint64, stat string, inc int64) {
m.Add(stat, inc)
}

func (p *Processor) activeNodes() ([]uint64, error) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could also be activeQueues, I could go either way.

@otoolep
Copy link
Contributor Author

otoolep commented Oct 9, 2015

OK, this is ready to go @jwilder and @corylanou

Lots of way to solve this, I think this should do it nicely.

if err := queue.Close(); err != nil {
return err
}
if err := os.RemoveAll(queue.dir); err != nil {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like this be a func on queue. queue.Remove()

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I thought about that, but wasn't sure. Should Remove() work on an open-queue? Should the queue be closed first? What are the semantic of this command?

All these reasons made me fall back on having this operation occur outside of the queue. (I started with having it as a method on the queue, as you suggest). I don't feel super strongly about this, and wasn't too happy with the code acting on path, technically an unexported variable (but fine obviously within the package).

I'm happy with whatever is clearest to the next guy.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd say return an error if you call Remove and the queue is not already closed.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, sounds good, I'll do that.

@jwilder
Copy link
Contributor

jwilder commented Oct 9, 2015

A couple of small things but otherwise LGTM. 👍

@otoolep
Copy link
Contributor Author

otoolep commented Oct 9, 2015

@jwilder -- there still seems to me to be an issue in PurgeOlderThan. If it's called multiple times, a segment will be added multiple times. I see no indication that it is idempotent.

Deletion only takes place if all data in the queue is older than the
configured time.
@otoolep
Copy link
Contributor Author

otoolep commented Oct 9, 2015

Feedback from @jwilder integrated, merging now.

otoolep added a commit that referenced this pull request Oct 9, 2015
HH should not process dropped nodes
@otoolep otoolep merged commit a2bdddf into master Oct 9, 2015
@otoolep otoolep deleted the dropped_server_hh branch October 9, 2015 03:40
@jwilder
Copy link
Contributor

jwilder commented Oct 9, 2015

@otoolep Looks like an existing bug. Should be straightforward to fix.

@otoolep
Copy link
Contributor Author

otoolep commented Oct 9, 2015

OK, I'll take care of it @jwilder.

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.

None yet

2 participants