You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2020/11/09 11:28:38 UTC

[GitHub] [apisix-dashboard] tokers opened a new issue #746: Bugs in GenericStore.Create and GenericStore.Update

tokers opened a new issue #746:
URL: https://github.com/apache/apisix-dashboard/issues/746


   - Why do you submit this issue?
   - [ ] Question or discussion
   - [x] Bug
   - [ ] Requirements
   - [ ] Feature or performance improvement
   - [ ] Other
   
   ### Bug
   
   The implements of GenericStore.Create and GenericStore.Update are pathological:
   
   ![image](https://user-images.githubusercontent.com/10428333/98535581-52e98400-22c1-11eb-80af-f2a218f6a4ba.png)
   ![image](https://user-images.githubusercontent.com/10428333/98535598-5a109200-22c1-11eb-9dc1-d3e6c640bea7.png)
   
   It's not safe to only resort to the in-memory cache to check the pre-conditions, instead, use etcd's built-in Mini transaction to achieve this. That might break the current abstraction of `Store`, i think some extensions are essential.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix-dashboard] nic-chen commented on issue #746: Bugs in GenericStore.Create and GenericStore.Update

Posted by GitBox <gi...@apache.org>.
nic-chen commented on issue #746:
URL: https://github.com/apache/apisix-dashboard/issues/746#issuecomment-744218492


   ping @tokers 


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix-dashboard] juzhiyuan commented on issue #746: Bugs in GenericStore.Create and GenericStore.Update

Posted by GitBox <gi...@apache.org>.
juzhiyuan commented on issue #746:
URL: https://github.com/apache/apisix-dashboard/issues/746#issuecomment-765104426


   Then you need to fix this ASAP once 2.4 is released, or this issue would always exist here.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix-dashboard] github-actions[bot] commented on issue #746: Bugs in GenericStore.Create and GenericStore.Update

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on issue #746:
URL: https://github.com/apache/apisix-dashboard/issues/746#issuecomment-942893806


   This issue has been marked as stale due to 30 days of inactivity. It will be closed in 2 weeks if no further activity occurs. If this issue is still relevant, please simply write any comment. Even if closed, you can still revive the issue at any time or discuss it on the dev@apisix.apache.org list. Thank you for your contributions.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix-dashboard] ShiningRush edited a comment on issue #746: Bugs in GenericStore.Create and GenericStore.Update

Posted by GitBox <gi...@apache.org>.
ShiningRush edited a comment on issue #746:
URL: https://github.com/apache/apisix-dashboard/issues/746#issuecomment-725796327


   > What is the divergent-change?
   
   It means implement a feature cause multiple component changes.Oh, sorry for using a wrong word, what I want to say is `shotgun-surgery`.
   `divergent-change` mean multiple feature will cause the same component changes.
   Both them are code smell from `<Refactoring>`
   
   >  it's totally OK to fallback this two methods to normal Update, Create
   
   It is OK, but not necessary, right? Know less is more better(Least Knowledge Principle).


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix-dashboard] tokers commented on issue #746: Bugs in GenericStore.Create and GenericStore.Update

Posted by GitBox <gi...@apache.org>.
tokers commented on issue #746:
URL: https://github.com/apache/apisix-dashboard/issues/746#issuecomment-725779818


   > > Actually the creatRevision or modRevision is good enough to solve this issue, i ever solved in APISIX's admin api.
   > 
   > * What is `creatRevision `?ETCD have just three version: `revision`, `modRevision`, `version` as far as I know.
   > * I am curious how to solve this problem without breaking the abstraction if the revision is not marked in the entity.
   >   (BTW: k8s also use a similar way to solve this problem)
   
   See https://github.com/etcd-io/etcd/blob/master/api/mvccpb/kv.proto#L16 for the details. It was the etcd revision that the key was created.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix-dashboard] ShiningRush commented on issue #746: Bugs in GenericStore.Create and GenericStore.Update

Posted by GitBox <gi...@apache.org>.
ShiningRush commented on issue #746:
URL: https://github.com/apache/apisix-dashboard/issues/746#issuecomment-724057254


   The timeliness of the cache based on the event mechanism is not completely synchronized. If a data is deleted from etcd, but no event is generated or the event has not been processed yet, it is acceptable to prompt the user that there is a conflict at this time, and the user just need post again.
   In essence, any project that uses caching technology has such a time difference, isn't it?


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix-dashboard] tokers edited a comment on issue #746: Bugs in GenericStore.Create and GenericStore.Update

Posted by GitBox <gi...@apache.org>.
tokers edited a comment on issue #746:
URL: https://github.com/apache/apisix-dashboard/issues/746#issuecomment-725792223


   > > See https://github.com/etcd-io/etcd/blob/master/api/mvccpb/kv.proto#L16 for the details. It was the etcd revision that the key was created.
   > 
   > got it
   > 
   > > The *revision was in mvccpb.KeyValue, which wraps APISIX resources in value, the thing we need to do is extending the storage interface to expose some methods like CompareAndSet, ExclCreate and etc.
   > 
   > This is not a good way for:
   > 
   > * it increased the complexity of storage usage and prompted the `store` to change the code, which caused divergent-change and was not a good design
   > * From an abstract point of view, `CompareAndSet` and `ExclCreate` is not an action for all storage. Suppose we switch to RDBS or NoSQL, they all naturally support the `update ... where ...` operation
   > 
   > > Do you mean the resource version?
   > 
   > Yes
   
   > From an abstract point of view, CompareAndSet and ExclCreate is not an action for all storage. Suppose we switch to RDBS or NoSQL, they all naturally support the update ... where ... operation
   
   > it increased the complexity of storage usage and prompted the store to change the code, which caused divergent-change and was not a good design
   
   What is the `divergent-change`?
   
   * From an abstract point of view, CompareAndSet and ExclCreate is not an action for all storage. Suppose we switch to RDBS or NoSQL, they all naturally support the update ... where ... operation
   
   I'm not so familiar with current manager api code base, so another way is you can hide these attributes inside the `Create` or `Update` methods. But even we migrate to RDBS or others, it's totally OK to fallback this two methods to normal Update, Create. It depends on how we keep the consistency of interface, which is not coupling with the real store.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix-dashboard] tokers commented on issue #746: Bugs in GenericStore.Create and GenericStore.Update

Posted by GitBox <gi...@apache.org>.
tokers commented on issue #746:
URL: https://github.com/apache/apisix-dashboard/issues/746#issuecomment-725801467


   > > What is the divergent-change?
   > 
   > It means implement a feature cause multiple component changes.Oh, sorry for using a wrong word, what I want to say is `shotgun-surgery`.
   > `divergent-change` mean multiple features will cause the same component changes.
   > Both them are code smell from `<Refactoring>`
   > 
   > > it's totally OK to fallback this two methods to normal Update, Create
   > 
   > It is OK, but not necessary, right? Know less is more better(Least Knowledge Principle).
   
   The premise it you really can support the PATCH, exclusive CREATE in the current definition of store.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix-dashboard] tokers edited a comment on issue #746: Bugs in GenericStore.Create and GenericStore.Update

Posted by GitBox <gi...@apache.org>.
tokers edited a comment on issue #746:
URL: https://github.com/apache/apisix-dashboard/issues/746#issuecomment-725801467


   > > What is the divergent-change?
   > 
   > It means implement a feature cause multiple component changes.Oh, sorry for using a wrong word, what I want to say is `shotgun-surgery`.
   > `divergent-change` mean multiple features will cause the same component changes.
   > Both them are code smell from `<Refactoring>`
   > 
   > > it's totally OK to fallback this two methods to normal Update, Create
   > 
   > It is OK, but not necessary, right? Know less is more better(Least Knowledge Principle).
   
   The premise it you really can support the PATCH, exclusive CREATE in the current definition of store. As long as the current abstraction can meet these demands, no new extensions should be introduced, we can further check out the current store abstraction and make the decision.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix-dashboard] membphis commented on issue #746: Bugs in GenericStore.Create and GenericStore.Update

Posted by GitBox <gi...@apache.org>.
membphis commented on issue #746:
URL: https://github.com/apache/apisix-dashboard/issues/746#issuecomment-724040896


   > Instead, use etcd's built-in Mini transaction to achieve this. That might break the current abstraction of `Store`, i think some extensions are essential.
   
   I think that is useful. please confirm @ShiningRush @nic-chen , what is your opinion?
   
   I think we can implement this feature in `2.1` or later.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix-dashboard] nic-chen commented on issue #746: Bugs in GenericStore.Create and GenericStore.Update

Posted by GitBox <gi...@apache.org>.
nic-chen commented on issue #746:
URL: https://github.com/apache/apisix-dashboard/issues/746#issuecomment-796626401


   @tokers  do you have time to fix this issue ?


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix-dashboard] tokers edited a comment on issue #746: Bugs in GenericStore.Create and GenericStore.Update

Posted by GitBox <gi...@apache.org>.
tokers edited a comment on issue #746:
URL: https://github.com/apache/apisix-dashboard/issues/746#issuecomment-725792223


   > > See https://github.com/etcd-io/etcd/blob/master/api/mvccpb/kv.proto#L16 for the details. It was the etcd revision that the key was created.
   > 
   > got it
   > 
   > > The *revision was in mvccpb.KeyValue, which wraps APISIX resources in value, the thing we need to do is extending the storage interface to expose some methods like CompareAndSet, ExclCreate and etc.
   > 
   > This is not a good way for:
   > 
   > * it increased the complexity of storage usage and prompted the `store` to change the code, which caused divergent-change and was not a good design
   > * From an abstract point of view, `CompareAndSet` and `ExclCreate` is not an action for all storage. Suppose we switch to RDBS or NoSQL, they all naturally support the `update ... where ...` operation
   > 
   > > Do you mean the resource version?
   > 
   > Yes
   
   > From an abstract point of view, CompareAndSet and ExclCreate is not an action for all storage. Suppose we switch to RDBS or NoSQL, they all naturally support the update ... where ... operation
   
   > it increased the complexity of storage usage and prompted the store to change the code, which caused divergent-change and was not a good design
   
   What is the `divergent-change`?
   
   * From an abstract point of view, CompareAndSet and ExclCreate is not an action for all storage. Suppose we switch to RDBS or NoSQL, they all naturally support the update ... where ... operation
   
   I'm not so familiar with current manager api code base, so another way is you can hide these attributes inside the `Create` or `Update` methods (just assign them these attributes). But even we migrate to RDBS or others, it's totally OK to fallback this two methods to normal Update, Create. It depends on how we keep the consistency of interface, which is not coupling with the real store.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix-dashboard] tokers edited a comment on issue #746: Bugs in GenericStore.Create and GenericStore.Update

Posted by GitBox <gi...@apache.org>.
tokers edited a comment on issue #746:
URL: https://github.com/apache/apisix-dashboard/issues/746#issuecomment-725792223


   > > See https://github.com/etcd-io/etcd/blob/master/api/mvccpb/kv.proto#L16 for the details. It was the etcd revision that the key was created.
   > 
   > got it
   > 
   > > The *revision was in mvccpb.KeyValue, which wraps APISIX resources in value, the thing we need to do is extending the storage interface to expose some methods like CompareAndSet, ExclCreate and etc.
   > 
   > This is not a good way for:
   > 
   > * it increased the complexity of storage usage and prompted the `store` to change the code, which caused divergent-change and was not a good design
   > * From an abstract point of view, `CompareAndSet` and `ExclCreate` is not an action for all storage. Suppose we switch to RDBS or NoSQL, they all naturally support the `update ... where ...` operation
   > 
   > > Do you mean the resource version?
   > 
   > Yes
   
   > From an abstract point of view, CompareAndSet and ExclCreate is not an action for all storage. Suppose we switch to RDBS or NoSQL, they all naturally support the update ... where ... operation
   
   > it increased the complexity of storage usage and prompted the store to change the code, which caused divergent-change and was not a good design
   
   What is the `divergent-change`?
   
   * From an abstract point of view, CompareAndSet and ExclCreate is not an action for all storage. Suppose we switch to RDBS or NoSQL, they all naturally support the update ... where ... operation
   
   I'm not so familiar with current manager api code base, so another way is you can hide these attributes inside the `Create` or `Update` methods.
   
   BTW, DO NOT ABSTRACT FOR ABSTRACT.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix-dashboard] tokers commented on issue #746: Bugs in GenericStore.Create and GenericStore.Update

Posted by GitBox <gi...@apache.org>.
tokers commented on issue #746:
URL: https://github.com/apache/apisix-dashboard/issues/746#issuecomment-725792223


   > > See https://github.com/etcd-io/etcd/blob/master/api/mvccpb/kv.proto#L16 for the details. It was the etcd revision that the key was created.
   > 
   > got it
   > 
   > > The *revision was in mvccpb.KeyValue, which wraps APISIX resources in value, the thing we need to do is extending the storage interface to expose some methods like CompareAndSet, ExclCreate and etc.
   > 
   > This is not a good way for:
   > 
   > * it increased the complexity of storage usage and prompted the `store` to change the code, which caused divergent-change and was not a good design
   > * From an abstract point of view, `CompareAndSet` and `ExclCreate` is not an action for all storage. Suppose we switch to RDBS or NoSQL, they all naturally support the `update ... where ...` operation
   > 
   > > Do you mean the resource version?
   > 
   > Yes
   
   > From an abstract point of view, CompareAndSet and ExclCreate is not an action for all storage. Suppose we switch to RDBS or NoSQL, they all naturally support the update ... where ... operation
   
   > it increased the complexity of storage usage and prompted the store to change the code, which caused divergent-change and was not a good design
   
   What is the `divergent-change`?
   
   * From an abstract point of view, CompareAndSet and ExclCreate is not an action for all storage. Suppose we switch to RDBS or NoSQL, they all naturally support the update ... where ... operation
   
   I'm not so familiar with current manager api code base, so another way is you can hide these attributes inside the `Create` or `Update` methods.
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix-dashboard] ShiningRush edited a comment on issue #746: Bugs in GenericStore.Create and GenericStore.Update

Posted by GitBox <gi...@apache.org>.
ShiningRush edited a comment on issue #746:
URL: https://github.com/apache/apisix-dashboard/issues/746#issuecomment-725789436


   > See https://github.com/etcd-io/etcd/blob/master/api/mvccpb/kv.proto#L16 for the details. It was the etcd revision that the key was created.
   
   got it
   
   > The *revision was in mvccpb.KeyValue, which wraps APISIX resources in value, the thing we need to do is extending the storage interface to expose some methods like CompareAndSet, ExclCreate and etc.
   
   This is not a good way for:
   - it increased the complexity of storage usage and prompted the `store` to change the code, which caused divergent-change and was not a good design
   - From an abstract point of view, `CompareAndSet` and `ExclCreate` is not an action for all storage. Suppose we switch to RDBS or NoSQL, they all naturally support the `update ... where ...` operation
   
   > Do you mean the resource version?
   
   Yes


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix-dashboard] nic-chen commented on issue #746: Bugs in GenericStore.Create and GenericStore.Update

Posted by GitBox <gi...@apache.org>.
nic-chen commented on issue #746:
URL: https://github.com/apache/apisix-dashboard/issues/746#issuecomment-799172684


   @tokers 
   Thanks for the sync status.
   I think this is not so emergency, we can deal with it later.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix-dashboard] ShiningRush edited a comment on issue #746: Bugs in GenericStore.Create and GenericStore.Update

Posted by GitBox <gi...@apache.org>.
ShiningRush edited a comment on issue #746:
URL: https://github.com/apache/apisix-dashboard/issues/746#issuecomment-725796327


   > What is the divergent-change?
   
   It means implement a feature cause multiple component changes.
   
   >  it's totally OK to fallback this two methods to normal Update, Create
   
   It is OK, but not necessary, right? Know less is more better(Least Knowledge Principle).


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix-dashboard] tokers edited a comment on issue #746: Bugs in GenericStore.Create and GenericStore.Update

Posted by GitBox <gi...@apache.org>.
tokers edited a comment on issue #746:
URL: https://github.com/apache/apisix-dashboard/issues/746#issuecomment-725779818






----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix-dashboard] tokers edited a comment on issue #746: Bugs in GenericStore.Create and GenericStore.Update

Posted by GitBox <gi...@apache.org>.
tokers edited a comment on issue #746:
URL: https://github.com/apache/apisix-dashboard/issues/746#issuecomment-725792223


   > > See https://github.com/etcd-io/etcd/blob/master/api/mvccpb/kv.proto#L16 for the details. It was the etcd revision that the key was created.
   > 
   > got it
   > 
   > > The *revision was in mvccpb.KeyValue, which wraps APISIX resources in value, the thing we need to do is extending the storage interface to expose some methods like CompareAndSet, ExclCreate and etc.
   > 
   > This is not a good way for:
   > 
   > * it increased the complexity of storage usage and prompted the `store` to change the code, which caused divergent-change and was not a good design
   > * From an abstract point of view, `CompareAndSet` and `ExclCreate` is not an action for all storage. Suppose we switch to RDBS or NoSQL, they all naturally support the `update ... where ...` operation
   > 
   > > Do you mean the resource version?
   > 
   > Yes
   
   > From an abstract point of view, CompareAndSet and ExclCreate is not an action for all storage. Suppose we switch to RDBS or NoSQL, they all naturally support the update ... where ... operation
   
   > it increased the complexity of storage usage and prompted the store to change the code, which caused divergent-change and was not a good design
   
   What is the `divergent-change`?
   
   * From an abstract point of view, CompareAndSet and ExclCreate is not an action for all storage. Suppose we switch to RDBS or NoSQL, they all naturally support the update ... where ... operation
   
   I'm not so familiar with current manager api code base, so another way is you can hide these attributes inside the `Create` or `Update` methods.
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix-dashboard] github-actions[bot] commented on issue #746: Bugs in GenericStore.Create and GenericStore.Update

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on issue #746:
URL: https://github.com/apache/apisix-dashboard/issues/746#issuecomment-953704466


   This issue has been closed due to lack of activity. If you think that is incorrect, or the issue requires additional review, you can revive the issue at any time.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix-dashboard] ShiningRush edited a comment on issue #746: Bugs in GenericStore.Create and GenericStore.Update

Posted by GitBox <gi...@apache.org>.
ShiningRush edited a comment on issue #746:
URL: https://github.com/apache/apisix-dashboard/issues/746#issuecomment-725796327


   > What is the divergent-change?
   
   It means implement a feature cause multiple component changes.Oh, sorry for using a wrong word, what I want to say is `shotgun-surgery`.
   `divergent-change` mean multiple features will cause the same component changes.
   Both them are code smell from `<Refactoring>`
   
   >  it's totally OK to fallback this two methods to normal Update, Create
   
   It is OK, but not necessary, right? Know less is more better(Least Knowledge Principle).


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix-dashboard] ShiningRush commented on issue #746: Bugs in GenericStore.Create and GenericStore.Update

Posted by GitBox <gi...@apache.org>.
ShiningRush commented on issue #746:
URL: https://github.com/apache/apisix-dashboard/issues/746#issuecomment-725420429


   > Actually the creatRevision or modRevision is good enough to solve this issue, i ever solved in APISIX's admin api.
   
   - What is `creatRevision `?ETCD have just three version: `revision`, `modRevision`, `version` as far as I know.
   - I am curious how to solve this problem without breaking the abstraction if the revision is not marked in the entity.
   (BTW: k8s also use a similar way to solve this problem)


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix-dashboard] ShiningRush edited a comment on issue #746: Bugs in GenericStore.Create and GenericStore.Update

Posted by GitBox <gi...@apache.org>.
ShiningRush edited a comment on issue #746:
URL: https://github.com/apache/apisix-dashboard/issues/746#issuecomment-724057254


   The timeliness of the cache based on the event mechanism is not completely synchronized. If a data is deleted from etcd, but no event is generated or the event has not been processed yet, it is acceptable to prompt the user that there is a conflict at this time, and the user just need post again.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix-dashboard] nic-chen commented on issue #746: Bugs in GenericStore.Create and GenericStore.Update

Posted by GitBox <gi...@apache.org>.
nic-chen commented on issue #746:
URL: https://github.com/apache/apisix-dashboard/issues/746#issuecomment-765091552


   not urgent, we could move to the next version
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix-dashboard] ShiningRush commented on issue #746: Bugs in GenericStore.Create and GenericStore.Update

Posted by GitBox <gi...@apache.org>.
ShiningRush commented on issue #746:
URL: https://github.com/apache/apisix-dashboard/issues/746#issuecomment-725789436


   > See https://github.com/etcd-io/etcd/blob/master/api/mvccpb/kv.proto#L16 for the details. It was the etcd revision that the key was created.
   
   got it
   
   > The *revision was in mvccpb.KeyValue, which wraps APISIX resources in value, the thing we need to do is extending the storage interface to expose some methods like CompareAndSet, ExclCreate and etc.
   
   This is not a good way for:
   - it increased the complexity of storage usage and prompted the `store` to change the code, which caused divergent-change and was not a good design
   - From an abstract point of view, `CompareAndSet` and `ExclCreate` is not an action for all storage. Suppose we switch to RDBS or NoSQL, they all naturally support the `update ... where ...` operation
   
   > Do you mean the resource version?
   Yes


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix-dashboard] github-actions[bot] closed issue #746: Bugs in GenericStore.Create and GenericStore.Update

Posted by GitBox <gi...@apache.org>.
github-actions[bot] closed issue #746:
URL: https://github.com/apache/apisix-dashboard/issues/746


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix-dashboard] juzhiyuan commented on issue #746: Bugs in GenericStore.Create and GenericStore.Update

Posted by GitBox <gi...@apache.org>.
juzhiyuan commented on issue #746:
URL: https://github.com/apache/apisix-dashboard/issues/746#issuecomment-813701676


   This issue is hold for a long time, do we really need this?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix-dashboard] tokers commented on issue #746: Bugs in GenericStore.Create and GenericStore.Update

Posted by GitBox <gi...@apache.org>.
tokers commented on issue #746:
URL: https://github.com/apache/apisix-dashboard/issues/746#issuecomment-724413012


   > The timeliness of the cache based on the event mechanism is not completely synchronized. If a data is deleted from etcd, but no event is generated or the event has not been processed yet, it is acceptable to prompt the user that there is a conflict at this time, and the user just need post again.
   > 
   > And I don’t quite understand why mini-transactions will solve our problems here.
   > We only operate on one key at a time. mini-transactions seem to have no effect in this scenario?
   
   Let's just say the updating, we have to keep the atomicity, since the uprocess of pdating/patching is merging the changes into the existing one and put it into etcd, we must make sure there are no modifications between the timeline that we get the existing resource from etcd and put it back, so we can leverage the etcd transaction to put the resource **only if ** the modify revision isn't changed, indeed, that's just an optimistic locking trick.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix-dashboard] nic-chen commented on issue #746: Bugs in GenericStore.Create and GenericStore.Update

Posted by GitBox <gi...@apache.org>.
nic-chen commented on issue #746:
URL: https://github.com/apache/apisix-dashboard/issues/746#issuecomment-765091552


   not urgent, we could move to the next version
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix-dashboard] juzhiyuan commented on issue #746: Bugs in GenericStore.Create and GenericStore.Update

Posted by GitBox <gi...@apache.org>.
juzhiyuan commented on issue #746:
URL: https://github.com/apache/apisix-dashboard/issues/746#issuecomment-765104426


   Then you need to fix this ASAP once 2.4 is released, or this issue would always exist here.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix-dashboard] ShiningRush edited a comment on issue #746: Bugs in GenericStore.Create and GenericStore.Update

Posted by GitBox <gi...@apache.org>.
ShiningRush edited a comment on issue #746:
URL: https://github.com/apache/apisix-dashboard/issues/746#issuecomment-724057254


   The timeliness of the cache based on the event mechanism is not completely synchronized. If a data is deleted from etcd, but no event is generated or the event has not been processed yet, it is acceptable to prompt the user that there is a conflict at this time, and the user just need post again.
   
   And I don’t quite understand why mini-transactions will solve our problems here.
   We only operate on one key at a time. mini-transactions seem to have no effect in this scenario?


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix-dashboard] nic-chen commented on issue #746: Bugs in GenericStore.Create and GenericStore.Update

Posted by GitBox <gi...@apache.org>.
nic-chen commented on issue #746:
URL: https://github.com/apache/apisix-dashboard/issues/746#issuecomment-724414989


   Agree with  @tokers 's point of view, but this priority is not high, we can optimize in subsequent versions.
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix-dashboard] ShiningRush commented on issue #746: Bugs in GenericStore.Create and GenericStore.Update

Posted by GitBox <gi...@apache.org>.
ShiningRush commented on issue #746:
URL: https://github.com/apache/apisix-dashboard/issues/746#issuecomment-725394771


   Okay, got it, there is a problem of missing changes.
   We can add a field "resourceVersion" to entity, storage can use `resourceVersion` to check if it is modified by when storage update record, `resourcevVersion` could be `modRevision`.
   So we can fixed it from design and not break abstraction.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix-dashboard] ShiningRush commented on issue #746: Bugs in GenericStore.Create and GenericStore.Update

Posted by GitBox <gi...@apache.org>.
ShiningRush commented on issue #746:
URL: https://github.com/apache/apisix-dashboard/issues/746#issuecomment-725796327


   > What is the divergent-change?
   It means implement some features cause multiple component changes.
   
   >  it's totally OK to fallback this two methods to normal Update, Create
   It is OK, but not necessary, right? Know less is more better(Least Knowledge Principle).


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix-dashboard] tokers commented on issue #746: Bugs in GenericStore.Create and GenericStore.Update

Posted by GitBox <gi...@apache.org>.
tokers commented on issue #746:
URL: https://github.com/apache/apisix-dashboard/issues/746#issuecomment-725415017


   > Okay, got it, there is a problem of missing changes.
   > 
   > We can add a field "resourceVersion" to entity, storage can use `resourceVersion` to check if it is modified by when storage update record, `resourcevVersion` could be `modRevision`.
   > 
   > So we can fixed it from design and not break abstraction.
   
   Actually the creatRevision or modRevision is good enough to solve this issue, i ever solved in APISIX's admin api.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix-dashboard] tokers commented on issue #746: Bugs in GenericStore.Create and GenericStore.Update

Posted by GitBox <gi...@apache.org>.
tokers commented on issue #746:
URL: https://github.com/apache/apisix-dashboard/issues/746#issuecomment-799081930


   @nic-chen I'm still busying on other things, if this stuff is not so emergency, maybe we can do it later.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org