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 invalidation for the schema-list cache 2.2.0 branch (close #215) #218

Merged
merged 1 commit into from
Nov 21, 2022

Conversation

voropaevp
Copy link
Contributor

No description provided.

@voropaevp voropaevp changed the base branch from master to develop November 18, 2022 12:45
@@ -111,7 +111,8 @@ final case class Resolver[F[_]](repos: List[Registry], cache: Option[ResolverCac
def listSchemasResult(
vendor: Vendor,
name: Name,
model: Model
model: Model,
mustIncludeKey: Option[SchemaKey] = None
Copy link
Contributor

Choose a reason for hiding this comment

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

As this is public method, such change would mean breaking compatibility? So to avoid that, we could either:

  • don't touch this method, then basically copy all that content but with mustIncludeKey to the new listSchemasLike method.
  • extract this new method body to private method, listSchemasResult would call it with None, listSchemasLike with Some

Copy link
Contributor Author

@voropaevp voropaevp Nov 18, 2022

Choose a reason for hiding this comment

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

I have a suspicion that this method should not be public. Cached/NotCached should be transparent for the consumers. Could we just make it private?

However, since it is already public, I've added a 3 argument version of it. I'm pretty sure that the default value argument would compile to the same code. But just for the good measure.

F: Monad[F],
L: RegistryLookup[F],
C: Clock[F]
): F[Either[ResolutionError, SchemaList]] =
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it possible to return here full SchemaListLookupResult? I suspect it would be useful for caching in transformer?

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 functions in the same the the listSchemas does. The same argument as before as consumers shouldn't need to know if it came from the cache or not.

The transformer's result would be cached by the iglu-client, so I won't be building another caching wrapper.

Copy link
Contributor

Choose a reason for hiding this comment

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

In general yes, caching details should be hidden. But we needed that to build related cache in the transfromer -> see : #207 and usage in transformer snowplow/snowplow-rdb-loader@756b4a7

That's what I meant by 'caching in transformer' - on top of the cache in iglu-client build another cache for ddl Properties (in case of shredded type) and cache for ddl Field (in case of parquet type)

Copy link
Contributor

Choose a reason for hiding this comment

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

What about:

Is it possible to return here full SchemaListLookupResult

? When we add mentioned Field cache to transfromer, we'd need that. So maybe it's better to add full SchemaListLookupResult now and map on a consumer side. Otherwise, we would have to add this method in the next release or use full listSchemasResult(schemaKey.vendor, schemaKey.name, schemaKey.version.model, Some(schemaKey)) which is a bit verbose?

val resultTwo = resolver.listSchemasLike(schema101)

resultOne must beRight(SchemaList(List(schema100)))
resultTwo must beRight(SchemaList(List(schema100, schema101)))
Copy link
Contributor

Choose a reason for hiding this comment

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

If there is 1-0-2 added to the iglucentral this test would fail?

CHANGELOG Outdated
@@ -1,3 +1,7 @@
Version 2.2.0 (2022-11-18)
Copy link
Contributor

Choose a reason for hiding this comment

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

Aaand I think this commit shouldn't be here? ;)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Why not? It was created during the release in master, it should be picked to develop.

Copy link
Contributor

Choose a reason for hiding this comment

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

But...2.2.0 hasn't been released yet? I think it will be when all those pending PRs are merged :)

@voropaevp voropaevp force-pushed the feature/list-schema-list-2.2.0 branch from e5a9666 to 6c30d7f Compare November 21, 2022 14:37
@voropaevp voropaevp merged commit b25261e into develop Nov 21, 2022
@voropaevp voropaevp deleted the feature/list-schema-list-2.2.0 branch November 21, 2022 14:41
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