Skip to content
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

couchdb: Replicate() doesn't return proper status #656

Open
flimzy opened this issue Apr 25, 2021 · 0 comments
Open

couchdb: Replicate() doesn't return proper status #656

flimzy opened this issue Apr 25, 2021 · 0 comments

Comments

@flimzy
Copy link
Member

flimzy commented Apr 25, 2021

It seems that the Replicate() function looks for an id field in the response, and assumes this is a replication doc id. This field doesn't actually appear--at least not always.

From 2.2.0:

{
  "ok": true,
  "session_id": "7f82f0ae7134887bdff049ff79c196ac",
  "source_last_seq": "1-g1AAAAGfeJzLYWBg4MhgTmHgzcvPy09JdcjLz8gvLskBCjMlMiTJ____PyuDOZEhFyjAnmaeamlubpbCwFmal5KalpmXmoJDa5ICkEyyR9FtYGJkYmlqSoxuB5DueKhuRrBuc1NTIwvzZHT1uExIAJlQDzIhkQGHmjwWIMnQAKSAyuYj3JlompacakCMLyEmLICYsJ-QTQcg6u4TUvcAog7k8iwA3at_ug",
  "replication_id_version": 4,
  "history": [
    {
      "session_id": "7f82f0ae7134887bdff049ff79c196ac",
      "start_time": "Sun, 25 Apr 2021 20:03:54 GMT",
      "end_time": "Sun, 25 Apr 2021 20:03:58 GMT",
      "start_last_seq": 0,
      "end_last_seq": "1-g1AAAAGfeJzLYWBg4MhgTmHgzcvPy09JdcjLz8gvLskBCjMlMiTJ____PyuDOZEhFyjAnmaeamlubpbCwFmal5KalpmXmoJDa5ICkEyyR9FtYGJkYmlqSoxuB5DueKhuRrBuc1NTIwvzZHT1uExIAJlQDzIhkQGHmjwWIMnQAKSAyuYj3JlompacakCMLyEmLICYsJ-QTQcg6u4TUvcAog7k8iwA3at_ug",
      "recorded_seq": "1-g1AAAAGfeJzLYWBg4MhgTmHgzcvPy09JdcjLz8gvLskBCjMlMiTJ____PyuDOZEhFyjAnmaeamlubpbCwFmal5KalpmXmoJDa5ICkEyyR9FtYGJkYmlqSoxuB5DueKhuRrBuc1NTIwvzZHT1uExIAJlQDzIhkQGHmjwWIMnQAKSAyuYj3JlompacakCMLyEmLICYsJ-QTQcg6u4TUvcAog7k8iwA3at_ug",
      "missing_checked": 1,
      "missing_found": 1,
      "docs_read": 1,
      "docs_written": 1,
      "doc_write_failures": 0
    }
  ]
}

From 3.0.0:

{
  "ok": true,
  "session_id": "87bf1c2a565f20976c4cb19a22528b7e",
  "source_last_seq": "6-g1AAAABteJzLYWBgYMpgTmHgzcvPy09JdcjLz8gvLskBCScyJNX___8_K4M5kS0XKMBunmRiYmRmhK4Yh_Y8FiDJ0ACk_oNMSWTIAgDY6SGt",
  "replication_id_version": 4,
  "history": [
    {
      "session_id": "87bf1c2a565f20976c4cb19a22528b7e",
      "start_time": "Sun, 25 Apr 2021 19:53:34 GMT",
      "end_time": "Sun, 25 Apr 2021 19:53:35 GMT",
      "start_last_seq": 0,
      "end_last_seq": "6-g1AAAABteJzLYWBgYMpgTmHgzcvPy09JdcjLz8gvLskBCScyJNX___8_K4M5kS0XKMBunmRiYmRmhK4Yh_Y8FiDJ0ACk_oNMSWTIAgDY6SGt",
      "recorded_seq": "6-g1AAAABteJzLYWBgYMpgTmHgzcvPy09JdcjLz8gvLskBCScyJNX___8_K4M5kS0XKMBunmRiYmRmhK4Yh_Y8FiDJ0ACk_oNMSWTIAgDY6SGt",
      "missing_checked": 2,
      "missing_found": 2,
      "docs_read": 2,
      "docs_written": 2,
      "doc_write_failures": 0
    }
  ]
}

Also, the whole way that the replication works seems a bit convoluted. Maybe it can be simplified.

@flimzy flimzy transferred this issue from go-kivik/couchdb Aug 28, 2023
@flimzy flimzy changed the title Replicate() doesn't return proper status couchdb: Replicate() doesn't return proper status Aug 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant