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

Add HTTP(s) Subscriptions #6655

Merged
merged 7 commits into from
May 19, 2016
Merged

Add HTTP(s) Subscriptions #6655

merged 7 commits into from
May 19, 2016

Conversation

nathanielc
Copy link
Contributor

@nathanielc nathanielc commented May 17, 2016

Adds support for the http and https protocols for subscriptions.

To use it specify a destination like so:

CREATE SUBSCRIPTION name ON db.rp DESTINATIONS ANY 'http://myhost.com:8086'

If a single HTTP based backed slows down for what ever reason all subscriptions will be effected but normal writes to InfluxDB will continue without issues. Should we isolate each of the destinations?

A config option has been added to the [subscription] section called http-timeout which specifies the client timeout when writing data to any http destination. Default is 30s

  • Rebased/mergable
  • Tests pass
  • CHANGELOG.md updated
  • Sign CLA (if not already signed)

@mention-bot
Copy link

By analyzing the blame information on this pull request, we identified @gunnaraasen and @e-dard to be potential reviewers

Database: p.Database,
RetentionPolicy: p.RetentionPolicy,
})
for _, p := range p.Points {
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not so fond of re-using an outer variable name for a different type... maybe pt for the internal or r for the WritePointsRequest?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agreed....

@joelegasse
Copy link
Contributor

Made a few comments here and there. My biggest concern is the serialization effect of waiting for the round-trip for HTTP subscriptions. Even for a single subscription target, each WritePointsRequest has to wait for the prior write to complete.

@nathanielc
Copy link
Contributor Author

@joelegasse I have updated the service to sends writes over a channel to each PointsWriter, this way writes can happen concurrently. Have a look and let me know what you think.

@joelegasse
Copy link
Contributor

The concurrency aspect is nice, but once a single subscription's buffered channel becomes full, it blocks everything... I'm not sure how these write requests correspond to incoming write requests to the server, but if the server is handling a concurrent write load, and each of those requests result in one WritePointsRequest, we're going to run in to an issue. Each subscription has these requests serialized to it's target.

I'm not sure I'm being much help here, since I'm not familiar enough with subscriptions to provide more knowledgeable recommendations, but... How would you feel about just dropping new WritePointsRequests to slow readers? If their channel is full, they probably won't catch up anytime soon, and we shouldn't punish the rest of the subscribers because of that.

@joelegasse
Copy link
Contributor

LGTM 👍

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

4 participants