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

Unable to change schemas #17914

Open
Spovis opened this issue Jan 10, 2023 · 2 comments
Open

Unable to change schemas #17914

Spovis opened this issue Jan 10, 2023 · 2 comments

Comments

@Spovis
Copy link

Spovis commented Jan 10, 2023

My Environment

  • ArangoDB Version: 3.9.3
  • Deployment Mode: Cluster (3 nodes)
  • Deployment Strategy: ArangoDB Starter
  • Configuration: sharded
  • Infrastructure: AWS
  • Operating System: Ubuntu 20.04 (I believe it is the default for arango hosting)
  • Total RAM in your machine: 3 x 4GiB
  • Disks in use: 3 x 20 GiB
  • Used Package:

Component, Query & Data

Affected feature:
Ability to update schema

Replication Factor & Number of Shards (Cluster only):
Replication factor: 3
Number of shards: 5

Steps to reproduce

  1. Create a new document collection with the following schema and settings:
{
  "cacheEnabled": false,
  "waitForSync": false,
  "type": 2,
  "shardKeys": [
    "_key"
  ],
  "schema": {
    "message": "",
    "level": "new",
    "type": "json",
    "rule": {
      "additionalProperties": true,
      "properties": {
        "created": {
          "type": "integer"
        },
        "creator": {
          "type": "string"
        },
        "name": {
          "type": "string"
        }
      },
      "required": [
        "created",
        "creator"
      ],
      "type": "object"
    }
  },
  "writeConcern": 1,
  "replicationFactor": 3,
  "name": "test_docs",
  "numberOfShards": 5
}
  1. Insert the following document into the collection:
{
  "created": 123,
  "creator": "me"
}
  1. Go back to the schema and remove the name field so that the schema is now the following:
{
  "message": "",
  "level": "new",
  "type": "json",
  "rule": {
    "properties": {
      "created": {
        "type": "integer"
      },
      "creator": {
        "type": "string"
      },
      "name": {
        "type": "string"
      }
    },
    "required": [
      "created",
      "creator"
    ],
    "additionalProperties": true,
    "type": "object"
  }
}
  1. It will go through and pop up the green message 'Saved schema for collection test_docs'
  2. Wait ~20 seconds
  3. Refresh the schema page
  4. The name field has reappeared in the schema

Problem:
The schema says that it has saved successfully, but it lies.

@dothebart
Copy link
Contributor

it appears that tests/js/common/shell/multi/shell-validation.js doesn't test this, thanks for pointing this out.

@cpjulia
Copy link
Contributor

cpjulia commented Jan 25, 2023

Hello, do you have more info on your issue? I tried to reproduce it with 3.9.3, a local cluster with 3 db servers, then create a collection with numberOfShards: 5 and replicationFactor: 3, then add your schema in the UI, then insert one single document just as your example to the collection, then go to the schema and remove the namefield (in your example, the schema is still the same as the original one, but I could understand that its final shape would be without the name field), then wait about 30 secs and reload the page. The name field was no longer there.

I may ask: do you run a proxy that could be stopping you from refreshing the page? Do you have a heavy load of data in your collections? Do you use oasis (I believe not as you posted this issue here) or a load balancer for this? More than one coordinator? In a theoretical scenario, a coordinator could not have received the updated schema info in time and showed you the old one

Edit: I see that there's no load balancing issue, and also see that, as the user said, the updated schema doesn't appear correctly after you refresh, but this happens when you delete a field and then insert another. If you just delete a field, it updates correctly. That's why I wasn't being able to reproduce it.
will work on this case

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants