-
Notifications
You must be signed in to change notification settings - Fork 82
Remove usage of eventing duck v1alpha1 shapes #426
Comments
We will also need something like this to migrate storage versions from v1alpha1 to v1beta1: That one was "pre-install", which we do not use anymore, but something like that as a post-install. |
@vaikas 🙈 that pre-job triggers bad memories |
So here's couple of PRs. Note that you must start using the v1beta1 channelable like in this PR so that any channels created during the migration will get the proper duck type and they will get reconciled properly. Here's post install script: For Brokers, we moved from v1alpha1 -> v1beta1 by installing this CRD first: So you could do something like that for kafka, apply first that flips the bits while the conversion from v1alpha1<->v1beta1 still works. Then run the pre-install storage migrator, then upgrade. |
Thanks for the pointers. I'm going to tackle it now. Since this issue is a duplicated of #71, I'm going to close this |
Well, maybe the issue is different? |
@vaikas I'm trying to find out how we can do this migration without pre-install jobs and smoothly across releases. So what I've done is:
My question is: can we keep the code and the v1alpha1 version in the crd (exactly as #446) during the lifecycle of 0.22 and then do the final code and crd yaml cleanup (issue #71) in 0.23? All that code should just remain unused during the 0.22 lifecycle, right? This way, we can ensure the transition is smooth across releases, without pre-install hacks. |
I do not think there's a way to do this smoothly without preinstall or adding some special handling for the kafka channel for the subscription controller. The problem is that the Subscription reconciler will treat the Channel differently (because the shapes are different) based on the label on the Channel. After #5005 in eventing went in, it will not have any understanding of the old channel types so it will not see the subscribers and it will produce wrong patches that will fail. Does any of that make sense @slinkydeveloper |
I think I lost you in this, but it seems similar to my idea:
This way we need no hacks, no pre-install jobs, and code should continue to work as usual Also ahmed is better than me at explaining things :) #448 (comment)
WDYM by this one in particular? v1alpha1 and v1beta1 kafka channels look identical, except for their ducks |
I think that will work, but you will have some downtime since after you upgrade eventing and before you complete the storage version, the channels will not get reconciled. If this is acceptable then that should work indeed. One problem is that if the job fails to upgrade for some reason you might be in a bad state. It's mosdef worth experimenting again if this is acceptable. The one thing I am curious about is that if there are cases where we will lose the information as in if the subscription controller will look at a channel that does not have subscriptions and will update it and if badness will happen. Because it's a patch I think not, but it would require some investigation for sure. v1alpha1 and v1beta1 are different because at the duck level v1alpha1 has extra level of indirection, so the subscription controller will not find the fields it's expecting. So if it looks for a Channel, say spec.subscribers (in v1beta1) and v1alpha1 has it at spec.subscriptionspec.subscribers (I don't remember exact field names, but for illustration purposes), then the subscription controller will look at a channel and see that there are no subscribers and it will try to produce a patch against the incorrect duck which will fail. |
I guess the tradeoff here is either this or the pre-install... which tradeoff do we want?
Ok I see your point, so what you're saying to me that in theory it might work, in practice some things might corrupt the CR, right? I guess I need to try the process on my machine and see what happens. If it doesn't fail, I assume it just works and we can proceed... @matzew @devguyio @aliok how does that sounds? |
@slinkydeveloper yes, I'm worried that the Channel gets written back to the storage, it's lossy and you'll lose all the subscription information from the channel. Now, this should get reconciled later, the questions are:
|
@vaikas thanks a lot for the detailed comments, really appreciated. I have some bad memories with pre-install, so I will be a little biased :)
IMO this workaround is the safest and easiest path, although it is yucky :) Other options:
Also, let me ping @travis-minke-sap although we might not need to touch the |
I think I've found the way to go, but it includes an hack in the subscription controller. I have a gist to reproduce the update process: https://gist.github.com/slinkydeveloper/59ab25d63fe8b14c298bbc1d9839fb62 |
@slinkydeveloper Thanks for the detailed gist. I will give it a try. |
@vaikas @aliok In a "normal" situation, how the subscription ref is supposed to be updated? Aka who is responsible for updating:
To this:
The hack I've implemented with knative/eventing#5085 makes the reconciler work, but it doesn't update the sub version... Who's supposed to do that? The user? Some update script? One of our reconcilers? 😄 |
I don't know where this is updated. I've never seen any release notes about any user action nor any upgrade script around that. Maybe the subscription reconciler should do it? |
I was just checking the gist. Is this a good summary?
|
Yep correct! And then after the 0.22 release, we clean up hacks and v1alpha1 code. Although I think, as last bit, we still need to solve the update of the refs. Somehow it doesn't sound right user has to do that by hand |
The procedure in the Gist works. I also added removed / added the subscription after the procedure to see what happens. Another test case I did was doing sacura logs - first part:
What is the frequency of Sacura sending messages? |
It's in the config, it seems to me it's running at 200 rps. Worst case, my assumption is that the system is not available for ~ 3 secs (looking at sacura log + kubectl describe) |
I can see this above: |
Ah, this is the 2nd case I mentioned above (doing the post-install first). In that case, possibly there are less problems |
Ok so I've found how to upgrade the subscription ref:
So now the sub channel ref is automatically bumped:
|
The whole migration path goes as follows:
|
I see the updated PR for eventing - will follow that |
@vaikas can you please check the solution proposed here? |
@slinkydeveloper looks pretty hacky but if it works, I'm fine with it. |
Signed-off-by: Matthias Wessendorf <mwessend@redhat.com>
Describe the bug
The v1alpha1 channelable shape has been deprecated forever and we need to remove it.
knative/eventing#5005
Looks like kafka still uses it and it's still storing channels as v1alpha1:
https://github.com/knative-sandbox/eventing-kafka/blob/master/config/channel/resources/kafkachannel-crd.yaml#L30
So, these will stop being reconciled once 5005 goes in. We should fix this asap so we can unblock the upstream work.
@matzew
A clear and concise description of what the bug is.
Expected behavior
Using supported ducks for Channelable.
To Reproduce
Steps to reproduce the behavior.
Knative release version
head
Additional context
Add any other context about the problem here such as proposed priority
The text was updated successfully, but these errors were encountered: