Move snapshot event publishing into metadata store#5674
Move snapshot event publishing into metadata store#5674fuweid merged 1 commit intocontainerd:mainfrom
Conversation
|
Build succeeded.
|
cf72139 to
0ebe085
Compare
|
Build succeeded.
|
0ebe085 to
83ca7a7
Compare
|
Build succeeded.
|
api/events/snapshot.proto
Outdated
There was a problem hiding this comment.
The fields only need to be unique and anything in the 1-15 range encodes to the same size. Since it is common across all the events, I choose a number higher than what any use so that it can be common and leave 1-4 reserved for event-specific fields. I am not a protobuf expert so I could be running afoul of some conventions here.
There was a problem hiding this comment.
I see. Sounds good to me. I'm not a protobuf expert though :)
|
Metadata package is growing in complexity, I'd try to avoid adding new responsibilities to it and have it just manage database. type GarbageCollect interface { Cleanup([]gc.Node) error; }Would this make sense? |
services/server/server.go
Outdated
There was a problem hiding this comment.
If possible, we can move the content plugin init out of services package.
There was a problem hiding this comment.
Yes, any plugin which isn't dynamically created via configuration should be moved out
|
/cc |
The metadata package sits on the bottom of the service stack and provides the implementation used by the services. The services could register GC callbacks to handle events triggered by GC, however, that adds complexity to to the service implementations and relationship between the packages. The event publishing as it exists today is even lower level as it is built directly into the plugin framework. It seems appropriate to do event publishing at the lowest level of the service stack from my perspective so we don't miss out on events when service logic is changed or added. I understand the concern about a single package growing in complexity compared to the complexity of other packages. My opinion is it is better to hide complexity in fewer packages rather than add complexity to the interfaces between them. We could always refactor the metadata package to separate the individual service interface implementations though. I would ideally like the metadata package not visible as a plugin but rather as those individual implementations. Right now it does contain quite a bit of the service logic, data persistence, and garbage collection. I think it would be quite a bit of effort to cleanly separate those 3 logical layers without performance degradation or increasing complexity even more. |
b91a011 to
ff0c675
Compare
|
Moving to "Needs Contributor Update" due to code conflicts. |
| case *eventstypes.SnapshotRemove: | ||
| topic = "/snapshot/remove" | ||
| default: | ||
| log.G(ctx).WithField("event", ne.event).Debug("unhandled event type from garbage collection removal") |
ff0c675 to
97e9a16
Compare
|
Build succeeded.
|
97e9a16 to
37cd85b
Compare
|
Build succeeded.
|
37cd85b to
a0d862e
Compare
|
Build succeeded.
|
|
This has been rebased is ready for review again |
|
@kzys are you still requesting a change? Can this be rebased? |
|
Needs rebase |
Removes the snapshot event publishing from the snapshot service. Adds an option to metadata db to add a publisher. Adds event publishing to prepare, commit, and remove snapshot operations. Adds remove snapshot event to garbage collection. Signed-off-by: Derek McGowan <[email protected]>
a0d862e to
2c573de
Compare
|
Updated, this PR is much simpler and smaller in scope now that the other changes have been split off and already merged. |
… main Updates ADO containerd fork-external/main with upstream containerd main @commit hash: f9f8455 containerd@f9f8455 Additional changes in the PR: - update linux container image version - remove copying LICENSE file in shared-build-stages.yml - additions to .gdnsuppress Related work items: containerd#5674, containerd#7393, containerd#7661, containerd#7685, containerd#7810, containerd#7850, containerd#7861, containerd#7879, containerd#7880, containerd#7881, containerd#7882, containerd#7883, containerd#7886, containerd#7887, containerd#7888, containerd#7891, containerd#7892, containerd#7893, containerd#7894, containerd#7903, containerd#7904, containerd#7905, containerd#7906, containerd#7907, containerd#7908, containerd#7911, containerd#7913, containerd#7914, containerd#7917, containerd#7925, containerd#7927, containerd#7928, containerd#7929, containerd#7932, containerd#7935, containerd#7943, containerd#7946, containerd#7948, containerd#7957, containerd#7958, containerd#7960, containerd#7963, containerd#7969, containerd#7970, containerd#7973
…/main Update fork-external/main with upstream containerd/containerd/main at commit hash 3d32da8 Related work items: containerd#5674, containerd#7129, containerd#7393, containerd#7661, containerd#7685, containerd#7810, containerd#7850, containerd#7861, containerd#7882, containerd#7883, containerd#7886, containerd#7891, containerd#7892, containerd#7893, containerd#7903, containerd#7904, containerd#7905, containerd#7906, containerd#7907, containerd#7908, containerd#7911, containerd#7913, containerd#7914, containerd#7917, containerd#7925, containerd#7927, containerd#7928, containerd#7929, containerd#7932, containerd#7935, containerd#7943, containerd#7946, containerd#7948, containerd#7957, containerd#7958, containerd#7959, containerd#7960, containerd#7963, containerd#7968, containerd#7969, containerd#7970, containerd#7973, containerd#7985, containerd#7987, containerd#7994, containerd#8005
Removes the snapshot event publishing from the snapshot service.
Cleans up metadata plugin registration into separate packages.
Adds an option to metadata db to add a publisher. Adds event
publishing to prepare, commit, and remove snapshot operations.
Adds remove snapshot event to garbage collection.
Adds snapshotter field to snapshot events
This is useful for snapshot caches which attempt to track current snapshots based on creation and deletion events. Most snapshots are not removed through the API, but through garbage collection. The end goal being the removal of the inefficient snapshot syncer in the CRI plugin