Skip to content

Support archive storage in the query-service#604

Merged
yurishkuro merged 2 commits intomasterfrom
archive-storage
Jan 8, 2018
Merged

Support archive storage in the query-service#604
yurishkuro merged 2 commits intomasterfrom
archive-storage

Conversation

@yurishkuro
Copy link
Copy Markdown
Member

@yurishkuro yurishkuro commented Dec 20, 2017

Users often ask for this feature. The trace retention period is usually short, and often people would put a link to the trace into some issue tracker to improve service performance, but by the time someone starts working on the ticket the trace has already expired.

Resolves #603

Signed-off-by: Yuri Shkuro <ys@uber.com>
fmt
Signed-off-by: Yuri Shkuro <ys@uber.com>
@coveralls
Copy link
Copy Markdown

Coverage Status

Coverage remained the same at 100.0% when pulling a2a80d1 on archive-storage into 8db7a11 on master.

@yurishkuro yurishkuro changed the title [WIP] Support archive storage in the query-service Support archive storage in the query-service Jan 8, 2018
@yurishkuro
Copy link
Copy Markdown
Member Author

ready for review

func archiveOptions(storageFactory istorage.Factory, logger *zap.Logger) []app.HandlerOption {
reader, err := storageFactory.CreateSpanReader()
if err == istorage.ErrArchiveStorageNotConfigured || err == istorage.ErrArchiveStorageNotSupported {
return nil
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Wouldn't this fail silently when ErrArchiveStorageNotConfigured is false; meaning it's configured; and when ErrArchiveStorageNotSupported is true?
Shouldn't we return the ErrArchiveStorageNotSupported when someone mistakenly configures archive storage on a storage that doesn't support archiving?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

it's not possible to configure archiving on a storage that doesn't support it. For example, with Cassandra you need to pass --cassandra-archive.enabled=true.

if f.archiveSession == nil {
return nil, storage.ErrArchiveStorageNotConfigured
}
return cSpanStore.NewSpanWriter(f.archiveSession, f.Options.SpanStoreWriteCacheTTL, f.metricsFactory, f.logger), nil
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'm a bit confused, is f.Options.SpanStoreWriteCacheTTL shared between both the archive and primary span writers?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

at the moment, yes. The retention period of archive storage is expected to be much longer that for primary, so the short cache TTL for the primary is fine for archive too. Strictly speaking we don't even need this cache for archive, but whatever.

primaryConfig config.SessionBuilder
primarySession cassandra.Session
// archiveSession cassandra.Session TODO
archiveConfig config.SessionBuilder
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I feel that the archiveConfig can be set to a higher default consistency level than the primaryConfig. What do you think?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

it's fully configurable by user. Given how marginal this feature is overall, I don't think introducing custom defaults per storage class is worth the complexity in the code.

Copy link
Copy Markdown
Contributor

@black-adder black-adder left a comment

Choose a reason for hiding this comment

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

do you wanna document this anywhere?

"github.com/jaegertracing/jaeger/pkg/cassandra"
"github.com/jaegertracing/jaeger/pkg/cassandra/mocks"
"github.com/jaegertracing/jaeger/pkg/config"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

ppppphhhhh


// CreateArchiveSpanReader implements storage.ArchiveFactory
func (f *Factory) CreateArchiveSpanReader() (spanstore.Reader, error) {
factory, ok := f.factories[f.SpanStorageType]
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

this means that the span store and archive span store both have to be using the same storage type? I think that's a fair assumption

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

it can be changed in the future by introducing another env var.

@yurishkuro
Copy link
Copy Markdown
Member Author

yurishkuro commented Jan 8, 2018

do you wanna document this anywhere?

yes, once the UI support is added to actually archive traces (jaegertracing/jaeger-ui#7).

@yurishkuro yurishkuro merged commit 7f1b9a2 into master Jan 8, 2018
@ghost ghost removed the review label Jan 8, 2018
@yurishkuro yurishkuro deleted the archive-storage branch May 6, 2018 19:46
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.

4 participants