GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — HA Cluster: INSERT with >5 new property keys per transaction fails with "Error on updating dictionary" · Issue #4039 · ArcadeData/arcadedb Closed Milestone DescriptionArcadeDB Version26.4.2 (build ef892b4/1776994711893/main) Environment
Expected behavior
Actual behaviorWhen a single INSERT introduces more than ~5 new property keys that don't yet exist in the Steps to reproduceThe script below creates a fresh database, tests INSERT with increasing numbers of new keys, Save as #!/usr/bin/env python3 """ ArcadeDB HA Dictionary Bug Reproducer Tests INSERT with increasing numbers of new property keys per transaction. On HA clusters, fails at ~10 new keys per transaction. """ import argparse import json import time import urllib.request import urllib.error import base64 import sys DB_NAME = "dict_bug_repro" def parse_args(): p = argparse.ArgumentParser(description="ArcadeDB HA dictionary bug reproducer") p.add_argument("--url", required=True, help="ArcadeDB HTTP endpoint (e.g. http://host:2480/api/v1)") p.add_argument("--user", required=True) p.add_argument("--password", required=True) return p.parse_args() class ArcadeClient: def __init__(self, url, user, password): self.url = url.rstrip("/") creds = base64.b64encode(f"{user}:{password}".encode()).decode() self.headers = {"Content-Type": "application/json", "Authorization": f"Basic {creds}"} def server_command(self, cmd): data = json.dumps({"command": cmd}).encode() req = urllib.request.Request(f"{self.url}/server", data=data, headers=self.headers, method="POST") try: with urllib.request.urlopen(req, timeout=30) as r: return r.status, r.read().decode() except urllib.error.HTTPError as e: return e.code, e.read().decode() def sql(self, db, command): data = json.dumps({"language": "sql", "command": command}).encode() req = urllib.request.Request(f"{self.url}/command/{db}", data=data, headers=self.headers, method="POST") try: with urllib.request.urlopen(req, timeout=30) as r: return r.status, r.read().decode() except urllib.error.HTTPError as e: return e.code, e.read().decode() def server_info(self): req = urllib.request.Request(f"{self.url}/server", headers=self.headers) with urllib.request.urlopen(req, timeout=10) as r: return json.loads(r.read().decode()) def main(): args = parse_args() client = ArcadeClient(args.url, args.user, args.password) # Server info print("Server Info") print("-" * 40) try: info = client.server_info() settings = {s["key"]: s["value"] for s in info.get("settings", [])} version = info.get("version", "?") ha = settings.get("arcadedb.ha.enabled", "?") quorum = settings.get("arcadedb.ha.quorum", "?") print(f" Version: {version}") print(f" HA enabled: {ha}") print(f" HA quorum: {quorum}") except Exception as e: print(f" Failed: {e}") sys.exit(1) # Setup client.server_command(f"drop database {DB_NAME}") status, _ = client.server_command(f"create database {DB_NAME}") if status != 200: print(f"Failed to create database") sys.exit(1) print(f"\nDatabase '{DB_NAME}' created\n") results = [] # Test 1: INSERT with N new keys print("Test 1: INSERT with N new property keys (one transaction)") print("-" * 55) for n in [1, 2, 3, 5, 8, 10, 15, 20, 50]: client.sql(DB_NAME, "DROP TYPE T IF EXISTS UNSAFE") client.sql(DB_NAME, "CREATE VERTEX TYPE T IF NOT EXISTS") record = {f"key_{i}": f"value_{i}" for i in range(n)} status, body = client.sql(DB_NAME, f"INSERT INTO T CONTENT {json.dumps(record)}") passed = status == 200 print(f" {n:3d} new keys: {'PASS' if passed else 'FAIL'}") if not passed: detail = json.loads(body).get("detail", "") if body.startswith("{") else body print(f" Error: {str(detail)[:120]}") results.append((f"INSERT {n} new keys", passed)) client.sql(DB_NAME, "DROP TYPE T IF EXISTS UNSAFE") # Test 2: 50 keys one at a time (1 key per transaction) print(f"\nTest 2: 50 sequential INSERTs (1 new key each)") print("-" * 55) client.sql(DB_NAME, "CREATE VERTEX TYPE T IF NOT EXISTS") ok = 0 for i in range(50): status, _ = client.sql(DB_NAME, f"INSERT INTO T CONTENT {json.dumps({f'prop_{i}': f'v_{i}'})}") if status == 200: ok += 1 print(f" {ok}/50 passed") results.append(("50 sequential 1-key INSERTs", ok == 50)) client.sql(DB_NAME, "DROP TYPE T IF EXISTS UNSAFE") # Summary print(f"\nSummary") print("=" * 55) for name, passed in results: print(f" {'PASS' if passed else 'FAIL'} {name}") # Cleanup client.server_command(f"drop database {DB_NAME}") print(f"\nDatabase '{DB_NAME}' dropped. Done.") if __name__ == "__main__": main() Sample output (bug confirmed)Activity
|
| You are visitor 01402775 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |