You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@couchdb.apache.org by "pgj (via GitHub)" <gi...@apache.org> on 2023/05/11 01:44:40 UTC

[GitHub] [couchdb] pgj opened a new pull request, #4594: fix(`mango`): covering indexes crash on partitioned databases

pgj opened a new pull request, #4594:
URL: https://github.com/apache/couchdb/pull/4594

   The previous work that introduced the keys-only covering indexes (#4512) did not count with the case that database might be partitioned. And since they use a different format for their own local indexes and the code does not handle that, it will crash.  When indexes are defined globally for the partitioned databases, there is no problem because the view row does not include information about the partition, i.e. it is transparent.
   
   Add the missing support for these scenarios and extend the test suite to cover them as well.  That latter required some changes to the base classes in the integration test suite as it apparently completely misses out on running test cases for partitioned databases.
   
   ## Checklist
   
   - [ ] Code is written and works correctly
   - [ ] Changes are covered by tests
   


-- 
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@couchdb.apache.org

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


[GitHub] [couchdb] nickva merged pull request #4594: fix(`mango`): covering indexes crash on partitioned databases

Posted by "nickva (via GitHub)" <gi...@apache.org>.
nickva merged PR #4594:
URL: https://github.com/apache/couchdb/pull/4594


-- 
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@couchdb.apache.org

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


[GitHub] [couchdb] pgj commented on a diff in pull request #4594: fix(`mango`): covering indexes crash on partitioned databases

Posted by "pgj (via GitHub)" <gi...@apache.org>.
pgj commented on code in PR #4594:
URL: https://github.com/apache/couchdb/pull/4594#discussion_r1191427830


##########
src/mango/test/user_docs.py:
##########
@@ -58,9 +60,18 @@ def setup_users(db, **kwargs):
     db.save_docs(copy.deepcopy(USERS_DOCS))
 
 
-def setup(db, index_type="view", **kwargs):
+def setup(db, index_type="view", partitioned=False, **kwargs):
     db.recreate()
-    db.save_docs(copy.deepcopy(DOCS))
+    p = str(partitioned).lower()
+    docs = copy.deepcopy(DOCS)
+
+    if partitioned:
+        for index, doc in zip(itertools.count(), docs):

Review Comment:
   Yes, thanks for the suggestion.  That is even shorter.



-- 
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@couchdb.apache.org

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


[GitHub] [couchdb] nickva commented on a diff in pull request #4594: fix(`mango`): covering indexes crash on partitioned databases

Posted by "nickva (via GitHub)" <gi...@apache.org>.
nickva commented on code in PR #4594:
URL: https://github.com/apache/couchdb/pull/4594#discussion_r1191324227


##########
src/mango/test/user_docs.py:
##########
@@ -58,9 +60,18 @@ def setup_users(db, **kwargs):
     db.save_docs(copy.deepcopy(USERS_DOCS))
 
 
-def setup(db, index_type="view", **kwargs):
+def setup(db, index_type="view", partitioned=False, **kwargs):
     db.recreate()
-    db.save_docs(copy.deepcopy(DOCS))
+    p = str(partitioned).lower()
+    docs = copy.deepcopy(DOCS)
+
+    if partitioned:
+        for index, doc in zip(itertools.count(), docs):

Review Comment:
   would `enumerate(docs)` work 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.

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

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