-
Notifications
You must be signed in to change notification settings - Fork 138
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
Rockon Container Links cannot handle duplicate sources #2900
Comments
Linking to @Hooverdan96 comments re suspected causes for this unintended and unexpected limitation re Django updates in our current testing channel: |
Noting that we need to establish if this bug is also exibited by our last Stable release. Where the model unique_together constraint was proposed to be appropriate. It has only been in this current testing phase that we have updated our Django to supposedly cause this issue: by not also adapting that clause in the model. |
The draft PR's Rock-on (Bareos backup server), in reproducer state for this issue, i.e. duplicated "source_container" entries (across two networks in that case) also reproduced this error when added via the local /opt/rockstor/rockons-metastore/ file repo on an instance of our last Stable release (v4.6.1-0) with a base OS of 15.5 (via our in-place update from 15.4 to 15.5):
I.e. when we were using Python 2.7 and Django 1.11.29:
|
From rockstor-core/src/rockstor/storageadmin/models/rockon.py Lines 113 to 120 in 4d60a2c
I.e. only one object at each end of a dcontainerlink.source <-> dcontainer. Which I read as each dcontainer can only have a single relationship to a sole dcontainerlink.source. @FroggyFlox Is that your reading of this constraint? |
@phillxnet... It appears you are correct, which means I used the wrong relationship there to being with 😞. I'm sorry for my mistake there; that was a a blatant misunderstanding of Django's |
@FroggyFlox Thanks for the confirmation on my model suspicions here re the OneToOne thing. No worries at all though: we just need to fathom a way through what we currently have in pending Stable (v5.1.x-x) and last Stable (v4.6.1.0). As I'd hoped, in the Bareos backup server, to minimise user intervention on getting a working docker-network. We could potentially develop a fix for both last and pending stable (current testing) but I'm keen to not break last stable via a Rock-ons definition. And our last stable was released for 15.4. Even given it can sustain our 15.4 to 15.5 treatment. In case we have both miss-interpreted the OneToOneField() there is the following examples orientated doc entry from Django's excellent documentation: https://docs.djangoproject.com/en/4.2/topics/db/examples/one_to_one/ [EDIT] We also have the OneToOne field definition as per our current (testing) Django docs entry: https://docs.djangoproject.com/en/4.2/ref/models/fields/#django.db.models.OneToOneField
Given the depth of this definition in our Rock-ons: I'm strongly favouring defining this as a newly surfaced limitation of our current Rock-ons "container_links" element. I.e. it was, after all, mutated from what came before re |
@Hooverdan96 & @FroggyFlox I'm tempted to kick this down the road for now, and address via a new json element that was actually proposed by @FroggyFlox originally: regarding a more full support of docker networks directly. And we then deprecate the old "container_links" Rock-on element. We then get to re-define how that works and this issue is the start of our documentation on the limitations we looks to have build-in here re our inheritance of the concepts associated with the |
As observed by @phillxnet during his experiments on a BareOS Rockon Draft PR 383 associated with this Issue: BareOS Rockon #94, I have experimented with a simplified linked Rocknet (aka docker network setup) to replicate the observed issue w.r.t. duplicate keys during the Rockon updates.
I created two definitions containing 1:n (RocknetTest.json) and n:1 (RocknetTest2.json) container links, respectively.
RockNet_Test.json
RockNet_Test2.json
the 1:n link is represented like this:
n:1 like this:
The first json definition updated fine into the Rockon database tables (and also provided a successful installation), the second one failed with the following error:
This is the same symptom that @phillxnet encountered.
One root cause could be that during the Django upgrade the format of the constraint meta tag
unique_together
changed from tuple of tuple (in 2.x) to list of lists (4.x). If that's the case, the code should be inspected for other this tag in other meta definitions and probably adjusted at the same time. With the above information it should be possible to test out this theory.The text was updated successfully, but these errors were encountered: