๋ฒ๊ทธ ์ค๋ช
๋ชจ๋ ์ข
๋ฅ์ ์ฝ์
์ ์ํ ํ ๋ ์คํค๋ง๊ฐ ์ผ์นํ์ง ์์ต๋๋ค.
์ค๋ฅ : "๊ฐ"์ด์ jsonb ์ ํ์ด์ง๋ง ํํ์์ ํ ์คํธ ์ ํ์ ๋๋ค.
์ฌํํ๋ ค๋ฉด
์ต์ ์์ค ๋ฐ postgres๋ฅผ ์ฌ์ฉํ์ญ์์ค. v12 ๋ฐ v13์ผ๋ก ์๋ํ์ต๋๋ค.
์์๋๋ ํ๋
์ค๋ฅ์์ด ์ฝ์
์ ์ํํฉ๋๋ค.
์คํฌ๋ฆฐ ์ท
etherpad_1 | [2020-09-08 20 : 37 : 50.541] [์ค๋ฅ] ์ฝ์-์ค๋ฅ : '๊ฐ'์ด์ jsonb ์ ํ์ด์ง๋ง ํํ์์ ํ
์คํธ ์ ํ์
๋๋ค.
etherpad_1 | Parser.parseErrorMessage (/opt/etherpad-lite/src/node_modules/pg-protocol/dist/parser.js:278:15)
etherpad_1 | Parser.handlePacket (/opt/etherpad-lite/src/node_modules/pg-protocol/dist/parser.js:126:29)
etherpad_1 | Parser.parse (/opt/etherpad-lite/src/node_modules/pg-protocol/dist/parser.js:39:38)
etherpad_1 | Socket.stream.on (/opt/etherpad-lite/src/node_modules/pg-protocol/dist/index.js:8:42)
etherpad_1 | Socket.emit (events.js : 198 : 13)
etherpad_1 | Socket.EventEmitter.emit (domain.js : 448 : 20)
etherpad_1 | addChunk์์ (_stream_readable.js : 288 : 12)
etherpad_1 | readableAddChunk (_stream_readable.js : 269 : 11)
etherpad_1 | Socket.Readable.push (_stream_Readable.js : 224 : 10)
etherpad_1 | at TCP.onStreamRead [as onread] (internal / stream_base_commons.js : 94 : 17)
๋ฐ์คํฌํ (๋ค์ ์ ๋ณด๋ฅผ ์์ฑํ์ญ์์ค) :
NA
์ค๋งํธ ํฐ (๋ค์ ์ ๋ณด๋ฅผ ์์ฑํ์ญ์์ค) :
NA
์ถ๊ฐ ์ปจํ
์คํธ
์ด๊ฒ์ ๋์ปค ์ปจํ
์ด๋๋ก ํ
์คํธ๋์์ต๋๋ค.
์ด๊ฒ์ ๋๋ถ๋ถ ๋ฆด๋ฆฌ์ค๋ฅผ ์ฌ์ฉํด์ผ ํ ๋ ์ต์ ์์ค๋ฅผ ์ฌ์ฉํ๋ ๋ฌธ์ ์ ๋๋ค.
๋๋ 1.8.4๋ก ์ด๊ฒ์ ์๋ ํ์ผ๋ฉฐ์ด ์ค๋ฅ๊ฐ ๋ฐ์ํ์ง ์๋๋ค๋ ๊ฒ์ ํ์ธํ ์ ์์ต๋๋ค. ๊ทธ์ ๋ฐ๋ผ ๋ฌธ์ ๋ฅผ ์ ๋ฐ์ดํธํ์ต๋๋ค.
1.8.5๋ฅผ ์ ์ธํ๊ณ ๋์ด ๋ฒ๊ทธ๊ฐ ํฌํจ๋์ด ์์ต๋๋ค.
c8361a211a1e6bfbbc006933f48d48ca51857c71์์ ์์ ๋จ
c8361a2 ์์ ์์
๋๋ ์์ง๋ ๊ทธ๊ฒ์ ์ป๋๋ค.
git pull ๋ค์ bin / run.sh ํ์ต๋๊น?
ueber๋ฅผ ์ ๋ฐ์ดํธํด์ผํ๋ฉฐ bin / run.sh๊ฐ์ด๋ฅผ ์ํํฉ๋๋ค. ๋น ๋ฅธ ์คํ์ ์ฌ์ฉํ์ง ๋ง์ญ์์ค
์, ์ ๋ ํญ์ bin/run.sh
ํฉ๋๋ค.
"ueberdb2": "^0.5.2"
๋ก ์
๋ฐ์ดํธ๋์์ต๋๋ค.
ํ ์คํธ๋ ์ ํต๊ณผํ๊ณ ์์ต๋๋ค.
์๋ก์ด pg dB plz๋ฅผ ์๋ํด ๋ณผ ์ ์์ต๋๊น? ์ด์ ์ปค๋ฐ์ด ๋ฐ์ดํฐ๋ฒ ์ด์ค๋ฅผ ์์ํ๋์ง ํ์ธํ๊ณ ์ถ์ต๋๋ค.
์๋ก์ด pg dB plz๋ฅผ ์๋ํด ๋ณผ ์ ์์ต๋๊น? ์ด์ ์ปค๋ฐ์ด ๋ฐ์ดํฐ๋ฒ ์ด์ค๋ฅผ ์์ํ๋์ง ํ์ธํ๊ณ ์ถ์ต๋๋ค.
๋ฌผ๋ก ์ ๋๋ค.
์๋ก์ด pg dB plz๋ฅผ ์๋ํด ๋ณผ ์ ์์ต๋๊น? ์ด์ ์ปค๋ฐ์ด ๋ฐ์ดํฐ๋ฒ ์ด์ค๋ฅผ ์์ํ๋์ง ํ์ธํ๊ณ ์ถ์ต๋๋ค.
์ค์ ๋ก ๋ด ๊ฐ๋ฐ ํ๊ฒฝ์ผ๋ก ์ธํด ๋ชจ๋ ๋น๋์์ ์๋ก์ด pg db๋ฅผ ์ป๊ณ ์์ต๋๋ค.
๊ทธ๋ฐ ๋ค์ ueberdb ํ ์คํธ๋ฅผ ์ํด ๋ฐ์ดํฐ๋ฒ ์ด์ค๋ฅผ ๋ง๋๋ ๋ฐฉ๋ฒ์ ํ์ธํ๊ธฐ ์ํด Travis ๊ตฌ์ฑ์ ํ์ธํฉ๋๋ค. ์ฌ๊ธฐ๊ฐ ์๋ ueber dB repo๋ฅผ ์ํ ๊ฒ์ ๋๋ค.
์๋ ์ ์ฅ์๋ฅผ ์ฌ์ฉํด์ผํ๋ ๊ฒ ๊ฐ์ต๋๊น?
https://github.com/ether/ueberDB#dirtyref
master
์๋
ํ์ธ์, 1.8.5์์๋์ด ๋ฌธ์ ๊ฐ ๋ฐ์ํ์ต๋๋ค. ํด๊ฒฐ์ฑ
์ ์ฐพ์ ๋๊น์ง์ด ๋ฌธ์ ๋ฅผ ๋ค์ ์ด ์ ์์ต๋๊น? (๊ทธ๋์ ์ฐพ๊ธฐ๊ฐ ๋ ์ฝ์ต๋๋ค!)
๊ฐ์ฌ!
cc @Gared
๋๋ ์ฌ์ ํ์ด ๋ฌธ์ ๊ฐ repo https://github.com/ether/ueberDB (๋ง์คํฐ)๋ก ๋ณ๊ฒฝ๋์์ต๋๋ค.
์ฌ๊ธฐ์์ ๋์ผ :
[2020-09-11 11:36:24.449] [ERROR] console - error: column "value" is of type jsonb but expression is of type text
at Parser.parseErrorMessage (/usr/local/var/etherpad/repo/src/node_modules/pg-protocol/dist/parser.js:278:15)
at Parser.handlePacket (/usr/local/var/etherpad/repo/src/node_modules/pg-protocol/dist/parser.js:126:29)
at Parser.parse (/usr/local/var/etherpad/repo/src/node_modules/pg-protocol/dist/parser.js:39:38)
at Socket.<anonymous> (/usr/local/var/etherpad/repo/src/node_modules/pg-protocol/dist/index.js:8:42)
at Socket.emit (events.js:315:20)
at Socket.EventEmitter.emit (domain.js:483:12)
at addChunk (_stream_readable.js:295:12)
at readableAddChunk (_stream_readable.js:271:9)
at Socket.Readable.push (_stream_readable.js:212:10)
at TCP.onStreamRead (internal/stream_base_commons.js:186:23)
[2020-09-11 11:36:24.463] [ERROR] console - TypeError: Cannot read property 'name' of null
at Client._handleParseComplete (/usr/local/var/etherpad/repo/src/node_modules/pg/lib/client.js:358:26)
at Connection.emit (events.js:315:20)
at Connection.EventEmitter.emit (domain.js:483:12)
at /usr/local/var/etherpad/repo/src/node_modules/pg/lib/connection.js:109:12
at Parser.parse (/usr/local/var/etherpad/repo/src/node_modules/pg-protocol/dist/parser.js:40:17)
at Socket.<anonymous> (/usr/local/var/etherpad/repo/src/node_modules/pg-protocol/dist/index.js:8:42)
at Socket.emit (events.js:315:20)
at Socket.EventEmitter.emit (domain.js:483:12)
at addChunk (_stream_readable.js:295:12)
at readableAddChunk (_stream_readable.js:271:9)
settings.json
:{
"dbSettings" : {
"user" : "etherpad",
"host" : "localhost",
"port" : 5432,
"password": "xxx",
"database": "etherpad",
},
"padOptions": {
"noColors": false,
"showControls": true,
"showChat": true,
"showLineNumbers": true,
"useMonospaceFont": false,
"userName": false,
"userColor": false,
"rtl": false,
"alwaysShowChat": false,
"chatAndUsers": false,
"lang": "de-de"
},
"suppressErrorsInPadText": false,
"requireSession": false,
"editOnly": true,
"sessionNoPassword": false,
"minify": true,
"maxAge": 21600,
"abiword": null,
"soffice": null,
"tidyHtml": null,
"allowUnknownFileEnds": true,
"requireAuthentication": false,
"requireAuthorization": false,
"trustProxy": true,
"disableIPlogging": true,
"automaticReconnectionTimeout": 5,
"users": {
"admin": {
"hash": "xxx",
"is_admin": true
}
},
"socketTransportProtocols" : ["xhr-polling", "jsonp-polling", "htmlfile"],
"loadTest": false,
"exposeVersion": false,
"loglevel": "WARN",
"logconfig" :
{ "appenders": [
{ "type": "console" }
]
}
}
SET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_session_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SELECT pg_catalog.set_config('search_path', '', false);
SET check_function_bodies = false;
SET xmloption = content;
SET client_min_messages = warning;
SET row_security = off;
CREATE EXTENSION IF NOT EXISTS plpgsql WITH SCHEMA pg_catalog;
COMMENT ON EXTENSION plpgsql IS 'PL/pgSQL procedural language';
CREATE FUNCTION public.ueberdb_insert_or_update(character varying, text) RETURNS void
LANGUAGE plpgsql
AS $_$ BEGIN IF EXISTS( SELECT * FROM store WHERE key = $1 ) THEN UPDATE store SET value = $2 WHERE key = $1; ELSE INSERT INTO store(key,value) VALUES( $1, $2 ); END IF; RETURN; END; $_$;
ALTER FUNCTION public.ueberdb_insert_or_update(character varying, text) OWNER TO etherpad;
CREATE FUNCTION public.ueberdb_insert_or_update_jsonb(character varying, jsonb) RETURNS void
LANGUAGE plpgsql
AS $_$ BEGIN IF EXISTS( SELECT * FROM store WHERE key = $1 ) THEN UPDATE store SET value = $2 WHERE key = $1; ELSE INSERT INTO store(key,value) VALUES( $1, $2 ); END IF; RETURN; END; $_$;
ALTER FUNCTION public.ueberdb_insert_or_update_jsonb(character varying, jsonb) OWNER TO etherpad;
SET default_tablespace = '';
SET default_with_oids = false;
CREATE TABLE public.store (
key character varying(100) NOT NULL,
value jsonb NOT NULL
);
ALTER TABLE public.store OWNER TO etherpad;
ALTER TABLE ONLY public.store
ADD CONSTRAINT store_pkey PRIMARY KEY (key);
๋๋ ๋กค๋ฐฑ ๊ธธ์ ํํ๋ค. etherpad๋ฅผ 1.8.4๋ก ๋กค๋ฐฑํ๋ ค๊ณ ํ์ง๋ง ์๋ํ์ง ์์์ต๋๋ค.
[2020-09-11 20:55:44.494] [ERROR] console - JSON-PROBLEM:[object Object]
[2020-09-11 20:55:44.495] [ERROR] console - (node:1) UnhandledPromiseRejectionWarning: SyntaxError: Unexpected token o in JSON at position 1
at JSON.parse (<anonymous>)
at /opt/etherpad-lite/src/node_modules/ueberdb2/CacheAndBufferLayer.js:169:24
at Query.<anonymous> (/opt/etherpad-lite/src/node_modules/ueberdb2/postgres_common.js:99:5)
at Query.handleReadyForQuery (/opt/etherpad-lite/src/node_modules/pg/lib/query.js:128:10)
at Connection.<anonymous> (/opt/etherpad-lite/src/node_modules/pg/lib/client.js:247:19)
at Connection.emit (events.js:198:13)
at Connection.EventEmitter.emit (domain.js:448:20)
at Socket.<anonymous> (/opt/etherpad-lite/src/node_modules/pg/lib/connection.js:134:12)
at Socket.emit (events.js:198:13)
at Socket.EventEmitter.emit (domain.js:448:20)
[2020-09-11 20:55:44.496] [ERROR] console - (node:1) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
[2020-09-11 20:55:44.496] [ERROR] console - (node:1) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
๊ทธ๋์ pgsql ๋คํ๋ ๋ณต์ํ๊ณ ์ด์ 1.8.4๊ฐ ๋ค์ ์๋ํฉ๋๋ค (์ ์๋ํ๊ธฐ ๋๋ฌธ์ ๋๋ผ์ด ์ผ์ ์๋๋๋ค).
์ด์ : 1.8.4์์ 1.8.5๋ก ์ด ๊ฐ์ด ํ
์คํธ ์ ํ์์ jsonb๋ก ๋ณ๊ฒฝ๋์์ต๋๋ค.
์ฃผ์ ๋ฆด๋ฆฌ์ค ์ฌ์ผํฉ๋๋ค ...
์ ์ฉ ํ ์์๋ ๋ง์ด๊ทธ๋ ์ด์ ์คํฌ๋ฆฝํธ๊ฐ ์์ต๋๊น?
์ด ์ปค๋ฐ์ ๋๋๋ฆด ๊ฒ์ ๋๋ค. ์ด๊ฒ์ ๋ชจ๋ ์๋ชป ์ฒ๋ฆฌ ๋ IMHO์์ต๋๋ค.
๋ณ๊ฒฝ ๋ก๊ทธ์ "์ค์ : 1.8.6์์ postgresql์ ์ฌ๊ฐํ ๋ฌธ์ ๊ฐ ํด๊ฒฐ๋์์ต๋๋ค."๋ผ๊ณ ํ์๋์ด ์์ต๋๋ค. ์ด์ ์๋น์ค๋ฅผ ๋ค์ ์์ํ ์งํ์ ์ถ๋ ฅ๋๋ ์ด๋ฌํ ์์ธ๋ ๋ฐ๊ฒฌํ์ต๋๋ค.
[2020-09-19 17:47:45.482] [ERROR] console - JSON-PROBLEM:[object Object]
[2020-09-19 17:47:45.496] [ERROR] console - (node:30613) UnhandledPromiseRejectionWarning: SyntaxError: Unexpected token o in JSON at position 1
at JSON.parse (<anonymous>)
at /usr/local/var/etherpad/repo/src/node_modules/ueberdb2/lib/CacheAndBufferLayer.js:169:24
at Query.<anonymous> (/usr/local/var/etherpad/repo/src/node_modules/ueberdb2/databases/postgres_common.js:99:5)
at Query.handleReadyForQuery (/usr/local/var/etherpad/repo/src/node_modules/pg/lib/query.js:122:12)
at Client._handleReadyForQuery (/usr/local/var/etherpad/repo/src/node_modules/pg/lib/client.js:281:19)
at Connection.emit (events.js:315:20)
at Connection.EventEmitter.emit (domain.js:483:12)
at /usr/local/var/etherpad/repo/src/node_modules/pg/lib/connection.js:109:12
at Parser.parse (/usr/local/var/etherpad/repo/src/node_modules/pg-protocol/dist/parser.js:40:17)
at Socket.<anonymous> (/usr/local/var/etherpad/repo/src/node_modules/pg-protocol/dist/index.js:8:42)
[2020-09-19 17:47:45.497] [ERROR] console - (node:30613) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
[2020-09-19 17:47:45.497] [ERROR] console - (node:30613) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
@ c7hm4r ๋ฐ์ดํฐ๋ฒ ์ด์ค๊ฐ ๋ณ๊ฒฝ ๋์์ต๋๊น? ์๋ก์ด tarble / ๋ฐ์ดํฐ๋ฒ ์ด์ค๋ฅผ ์์ํด๋ ๊ด์ฐฎ์ต๋๊น?
@JohnMcLear ๋น ๋ฐ์ดํฐ๋ฒ ์ด์ค๋ก Etherpad 1.8.6์ ๋ค์ ์์ํ๋ฉด ์ ์คํค๋ง๊ฐ ์์ฑ๋๊ณ ์์ธ์์ด ์๋ํ๋ ๊ฒ์ฒ๋ผ ๋ณด์ ๋๋ค.
์ ์คํค๋ง๋ฅผ ์ด์ ์คํค๋ง์ ๋น๊ตํ ๋ ๋ค์๊ณผ ๊ฐ์ ๊ฒฐ๊ณผ๊ฐ ๋ํ๋ฉ๋๋ค.
diff --git a/etherpad_schema.sql b/etherpad_schema_new.sql
index 9baf5f4..ad3c08b 100644
--- a/etherpad_schema.sql
+++ b/etherpad_schema_new.sql
@@ -41,17 +41,6 @@ CREATE FUNCTION public.ueberdb_insert_or_update(character varying, text) RETURNS
ALTER FUNCTION public.ueberdb_insert_or_update(character varying, text) OWNER TO etherpad;
---
--- Name: ueberdb_insert_or_update_jsonb(character varying, jsonb); Type: FUNCTION; Schema: public; Owner: etherpad
---
-
-CREATE FUNCTION public.ueberdb_insert_or_update_jsonb(character varying, jsonb) RETURNS void
- LANGUAGE plpgsql
- AS $_$ BEGIN IF EXISTS( SELECT * FROM store WHERE key = $1 ) THEN UPDATE store SET value = $2 WHERE key = $1; ELSE INSERT INTO store(key,value) VALUES( $1, $2 ); END IF; RETURN; END; $_$;
-
-
-ALTER FUNCTION public.ueberdb_insert_or_update_jsonb(character varying, jsonb) OWNER TO etherpad;
-
SET default_tablespace = '';
SET default_with_oids = false;
@@ -62,7 +51,7 @@ SET default_with_oids = false;
CREATE TABLE public.store (
key character varying(100) NOT NULL,
- value jsonb NOT NULL
+ value text NOT NULL
);
๋ฐ๋ผ์ ์ง๋ฌธ์ ์ด ์ ํ์ด ๋ณ๊ฒฝ๋์๊ธฐ์์ด๋ฅผ ๋ง์ด๊ทธ๋ ์ด์ / ๋ ๋๋ฆฌ๋ ๋ฐฉ๋ฒ์ ๋๋ค.
๋ง์คํฐ ๋ธ๋์น์์ Etherpad ์ธ์คํด์ค์ ๋ํ ์๋ ์ ๋ฐ์ดํธ๋ฅผ ๊ตฌ์ฑํ์ต๋๋ค.
@ c7hm4r @qsuscs ๋ ๋ฌธ์ ๊ฐ๋๋ ์ปค๋ฐ์ ์์ฑ์์์ต๋๋ค. ๋๋ ๊ทธ๊ฐ ์ฌ๊ธฐ์์ ์ฝ๊ฐ์ ์ฑ ์์์ง๊ณ ๋์์ด๋๊ธฐ๋ฅผ ๋ฐ๋๋๋ค. :)
https://github.com/ether/ueberDB/commit/b9e786e2c8753f4cbbe09d3695a92a1a03904ead#diff -f1b8245dd259fa912c33cb2db527f609R31์ alter ๋ฌธ์ ๋๋ค ..
var updateValueColumnType = "ALTER TABLE store " +
"ALTER COLUMN value " +
"TYPE jsonb " +
"USING value::jsonb";
jsonb๋ฅผ ํ ์คํธ๋ก ๋ณ๊ฒฝํ๋ฉด ํ ์ ์๋ค๊ณ ๊ฐ์ ํฉ๋๊น?
๊ฐ์ฌํฉ๋๋ค @JohnMcLear , ๋ค์์ ์คํํ๋ฉด ๋ค์ ์๋ํฉ๋๋ค.
alter table "store" alter column "value" type text;
@ c7hm4r ๊ฑฑ์ ํ์ง ๋ง์ธ์.์ด ์ํฅ์๋ฐ๋ ์์์ ์ฌ๋๋ค์ด์ด ์ค๋ ๋๋ฅผ ์ฐพ์์ ํด๋น ๋ช ๋ น์ ์ํ ํ ๊ฒ์ ๋๋ค. ์์ฑํ๊ณ ํ ์คํธ ํด ์ฃผ์ ์ ๊ฐ์ฌํฉ๋๋ค! :) ๋ณธ์ธ์ด๋ ์์ ์๊ฐ ์ํ๋ฉด PR์ ๋ฐ์ ์์ ํ๊ฒ ์ต๋๋ค. ํ์ฌ ์ฐ์ ์์๋ฅผ๋๊ณ ์๋ ๋ค๋ฅธ ์์ ์ด ์์ต๋๋ค.
๊ฐ์ฅ ์ ์ฉํ ๋๊ธ
๊ฐ์ฌํฉ๋๋ค @JohnMcLear , ๋ค์์ ์คํํ๋ฉด ๋ค์ ์๋ํฉ๋๋ค.