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

Remove archive storage factory #5279

Draft
wants to merge 14 commits into
base: main
Choose a base branch
from

Conversation

akagami-harsh
Copy link
Member

@akagami-harsh akagami-harsh commented Mar 16, 2024

Which problem is this PR solving?

  • Simplify Storage: Remove ArchiveFactory, Use Storage.Factory

Description of the changes

How was this change tested?

  • some test are still failing working on fixing them

Checklist

akagami-harsh and others added 2 commits March 16, 2024 23:32
Signed-off-by: Harshvir Potpose <hpotpose62@gmail.com>
return false
}
reader, err := archiveFactory.CreateArchiveSpanReader()
reader, err := storageFactory.CreateSpanReader()
Copy link
Member

Choose a reason for hiding this comment

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

This is not equivalent to previous behavior. Whoever calls this function is passing the primary storage factory, and you're just using it straight up.

Copy link

codecov bot commented Mar 17, 2024

Codecov Report

Attention: Patch coverage is 0% with 3 lines in your changes are missing coverage. Please review.

Project coverage is 41.01%. Comparing base (727bf18) to head (3277039).

Files Patch % Lines
cmd/query/app/querysvc/query_service.go 0.00% 3 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##             main    #5279       +/-   ##
===========================================
- Coverage   95.16%   41.01%   -54.15%     
===========================================
  Files         340      212      -128     
  Lines       16666    10981     -5685     
===========================================
- Hits        15860     4504    -11356     
- Misses        616     6073     +5457     
- Partials      190      404      +214     
Flag Coverage Δ
badger 12.25% <ø> (ø)
cassandra-3.x 21.14% <ø> (ø)
cassandra-4.x 21.14% <ø> (ø)
elasticsearch-5.x 17.68% <ø> (-0.02%) ⬇️
elasticsearch-6.x 17.70% <ø> (ø)
elasticsearch-7.x 17.76% <ø> (+0.01%) ⬆️
elasticsearch-8.x 17.82% <ø> (-0.02%) ⬇️
grpc 11.60% <0.00%> (-0.01%) ⬇️
kafka 11.84% <ø> (ø)
opensearch-1.x 17.75% <ø> (-0.02%) ⬇️
opensearch-2.x 17.75% <ø> (ø)
unittests ?

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Signed-off-by: Harshvir Potpose <hpotpose62@gmail.com>
Signed-off-by: Harshvir Potpose <hpotpose62@gmail.com>
Signed-off-by: Harshvir Potpose <hpotpose62@gmail.com>
@@ -45,6 +45,12 @@ type Factory interface {
// CreateSpanWriter creates a spanstore.Writer.
CreateSpanWriter() (spanstore.Writer, error)

// CreateArchiveSpanReader creates a spanstore.Writer for archived spans.
CreateArchiveSpanReader() (spanstore.Reader, error)
Copy link
Member

Choose a reason for hiding this comment

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

I think you are on the wrong path. The point was to remove "archive" from the interfaces (since its interface is identical to span storage), and only keep it as a configuration option. Eg

var primary = MyStorage(priArgs)
var archive = MyStorage(archArgs)

Here it's using the same api and implementation, just calls it "archive".

If at all possible we should try to avoid changing anything in v1 storage interface, because it's not necessary for v2. What does need to change is how query-service obtains an instance of archive storage. Right now query-service gets only one storage factory, and tries to cast it to ArchiveStorageFactory. Instead we should find a way to give it two factories, separately for primary and archive storage (if needed we can cast in main). Then for v2 it would be trivial because it naturally gets two independent factories already labeled primary/archive and it can pass them to the query-service.

akagami-harsh and others added 6 commits March 24, 2024 18:34
Signed-off-by: Harshvir Potpose <hpotpose62@gmail.com>
Signed-off-by: Harshvir Potpose <hpotpose62@gmail.com>
Signed-off-by: Harshvir Potpose <hpotpose62@gmail.com>
Signed-off-by: Harshvir Potpose <hpotpose62@gmail.com>
@yurishkuro
Copy link
Member

@akagami-harsh I see you fixing tests, but the direction itself doesn't seem right to me (#5279 (comment)). Can you elaborate?

@akagami-harsh
Copy link
Member Author

@akagami-harsh I see you fixing tests, but the direction itself doesn't seem right to me (#5279 (comment)). Can you elaborate?

@yurishkuro , i am trying do to what you explained in the comment. first i removed the storage.archiveFactory interface and then trying to find a way to pass in two separate factories in the query-service for primary and archive.

@yurishkuro
Copy link
Member

I also said we should only do it in the scope of jaeger-v2, not do a major change in v1 storage

If at all possible we should try to avoid changing anything in v1 storage interface, because it's not necessary for v2.

akagami-harsh and others added 2 commits April 1, 2024 04:48
Signed-off-by: Harshvir Potpose <hpotpose62@gmail.com>
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.

[jaeger-v2] Do away with storage.ArchiveFactory
2 participants