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

feat: Avoid writing twice to the same storage backend #157

Closed
wants to merge 1 commit into from

Conversation

mcortesi
Copy link
Contributor

handleRedundantWrites will do a write for each source in caches and fallbacks.

While probably doesn't make much sense to have the same type of store be cache and fallback they can technically be the same.

So maybe check that caches ++ fallbacks is an unique set.

Alternative, on configuration processing check that a source can't be at same time cache and fallback

@samlaf
Copy link
Collaborator

samlaf commented Sep 27, 2024

So we treat sources and fallbacks the same when writing? So I guess they are only differentiated by their read sequence logic? This looks fine to me, though I do have a strong preference for the config approach (KISS).

Alternative, on configuration processing check that a source can't be at same time cache and fallback

I'll let @epociask review this though given he wrote this feature.

@epociask
Copy link
Collaborator

Hi @mcortesi - there's already a config invariant to ensure that this case can never be true: https://github.com/Layr-Labs/eigenda-proxy/blob/main/server/config.go#L115-L120

@mcortesi
Copy link
Contributor Author

@epociask amazin, haven't seen that.. maybe a comment on the code will help for the unaware reader

@epociask
Copy link
Collaborator

epociask commented Oct 2, 2024

Closing PR since verifications are performed at the cfg invariant enforcement

@epociask epociask closed this Oct 2, 2024
@mcortesi mcortesi deleted the mcortesi/unique-writes branch October 3, 2024 13:01
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.

3 participants