testnet
λ€νΈμν¬μμ extended
λͺ¨λμ tags/5.0.0
μλ cardano-db-syncλ μ λμ½λ ꡬ문 λΆμ/μ²λ¦¬ λ¬Έμ λ‘ μΈν΄ λΈλ‘ 1816809μμ μμΈλ₯Ό λ°μμν΅λλ€. μ΄ λΈλ‘μ μ§λλ©΄ λκΈ°νν μ μμ΅λλ€.
[db-sync-node:Info:234667] [2020-09-19 14:23:20.41 UTC] Starting chainSyncClient
[db-sync-node:Info:234667] [2020-09-19 14:23:20.48 UTC] Cardano.Db tip is at slot 6061839, block 1816809
[db-sync-node:Info:234672] [2020-09-19 14:23:20.48 UTC] Running DB thread
[db-sync-node:Info:234672] [2020-09-19 14:23:20.65 UTC] Rolling back to slot 6061839, hash 98414d12d1d1f05210dea6ce4082e1bcbbcfdf56343fd1cb44a8778c4c9ea57a
[db-sync-node:Info:234672] [2020-09-19 14:23:20.66 UTC] Deleting blocks numbered: []
[db-sync-node:Error:234672] [2020-09-19 14:23:21.03 UTC] runDBThread: DbInsertException "TxMetadata" (SqlError {sqlState = "22P05", sqlExecStatus = FatalError, sqlErrorMsg = "unsupported Unicode escape sequence", sqlErrorDetail = "\\u0000 cannot be converted to text.", sqlErrorHint = ""})
[db-sync-node:Error:234667] [2020-09-19 14:23:21.05 UTC] ChainSyncWithBlocksPtcl: DbInsertException "TxMetadata" (SqlError {sqlState = "22P05", sqlExecStatus = FatalError, sqlErrorMsg = "unsupported Unicode escape sequence", sqlErrorDetail = "\\u0000 cannot be converted to text.", sqlErrorHint = ""})
[db-sync-node.Subscription:Error:234663] [2020-09-19 14:23:21.05 UTC] [String "Application Exception: LocalAddress {getFilePath = \"/run/cardano-node/node.socket\"} DbInsertException \"TxMetadata\" (SqlError {sqlState = \"22P05\", sqlExecStatus = FatalError, sqlErrorMsg = \"unsupported Unicode escape sequence\", sqlErrorDetail = \"\\\\u0000 cannot be converted to text.\", sqlErrorHint = \"\"})",String "SubscriptionTrace"]
[db-sync-node.ErrorPolicy:Error:4] [2020-09-19 14:23:21.05 UTC] [String "ErrorPolicyUnhandledApplicationException (DbInsertException \"TxMetadata\" (SqlError {sqlState = \"22P05\", sqlExecStatus = FatalError, sqlErrorMsg = \"unsupported Unicode escape sequence\", sqlErrorDetail = \"\\\\u0000 cannot be converted to text.\", sqlErrorHint = \"\"}))",String "ErrorPolicyTrace",String "LocalAddress {getFilePath = \"/run/cardano-node/node.socket\"}"]
μ΄κ²μ λͺ©μ μμ²λ ν΅μ¦μ λλ€.
μ½μ λλ tx λ©νλ°μ΄ν°λ
(1,S "\NUL\ETX\ETX\ETX\ETX\ETX\ETX\ETX\ETX\ETX\ETX\ETX\ETX\ETX\ETX\ETX\ETX\ETX\ETX\ETX\ETX\ETX\ETX\ETX\ETX\ETX\ETX\ETX\ETX\ETX\ETX\ETX\ETX\ETX\ETX\ETX\ETX\ETX\ETX\ETX\ETX\ETX\ETX\ETX\ETX\ETX\ETX\ETX\ETX\ETX\ETX\ETX\ETX\ETX\ETX\ETX\ETX\ETX\ETX\ETX\ETX\ETX\ETX\ETX")
JSONμΌλ‘ μΈμ½λ©λ©λλ€.
"\u0000\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0003"
λ¬Όλ‘ μ ν¨ν UTF8μ΄ μλλ―λ‘ λ°μ΄ν°λ² μ΄μ€κ° μ΄λ₯Ό κ±°λΆν©λλ€.
μ€μκ°μμΌλ‘ μμ κ°μ΄ Haskell Text
λΌμ΄λΈλ¬λ¦¬μ μν΄ μμ λ΄μ©μ΄ UTF8λ‘ μΈμ½λ©λμ§λ§ PostgreSQLμ μ΄λ₯Ό κ±°λΆν©λλ€.
μ΄κ²μ΄ λͺ©μ μΌλ§λ ν° κ³ ν΅μΈμ§ λ€μ ν λ² λ§μλλ¦¬κ² μ΅λλ€.
λ¬Έμ μ λ¬Έμμ΄μ Haskell Text
λΌμ΄λΈλ¬λ¦¬μ μν΄ UTF8λ‘ λμ½λ©λ λ€μ SqlError
μμΈκ° λ°μνλ Postgresλ‘ μ λ¬λ©λλ€. μ΄ μμΈλ₯Ό μ‘μΌλ €κ³ μλνμ§λ§ μμΈλ₯Ό μ‘λ κ²μ΄ μλνμ§ μλ κ² κ°μ΅λλ€.
μμΈλ₯Ό ν¬μ°©νκ³ κΈ°λ‘ν μ μμ΅λλ€.
[db-sync-node:Warning:37] [2020-09-21 00:26:18.77 UTC] insertTxMetadata: Failed to insert (1,S "\NUL...\ETX")
SqlError {sqlState = "22P05", sqlExecStatus = FatalError, sqlErrorMsg
= "unsupported Unicode escape sequence", sqlErrorDetail = "\\u0000 cannot be converted to text.", sqlErrorHint = ""}
κ·Έλ¬λ λ λ²μ§Έ μμΈκ° μμ΅λλ€.
[db-sync-node:Error:37] [2020-09-21 00:26:18.77 UTC] runDBThread: SqlError {sqlState = "25P02", sqlExecStatus = FatalError, sqlErrorMsg = "current transaction is aborted, commands ignored until end of transaction
block", sqlErrorDetail = "", sqlErrorHint = ""}
μ΄κ²μ μ½μ νκΈ° μ μ JSONμ λ μμ ν κ²μ¦ν΄μΌ ν¨μ μμ¬ν©λλ€.
μ°λ¦¬λ PostgreSQLμ λ¬΄ν¨ UTF8μ μ μ₯ν μ μμ§λ§μλ§ bytea
λ°μ΄ν°νμ§μΌλ‘ jsonb
μ°λ¦¬λ avaiableμ΄λ€κ°λμ§ μμ΅λλ€ μ΄μ ν¬μ€νΈ κ·Έλ μ€μ JSON 쿼리 μ§μμ μν΄ μ΄λν©λλ€.
μλ UTF8 λμ½λ©μ μλνμ΅λλ€.
decodeUtf8IO :: ByteString -> IO (Either Text.UnicodeException Text)
decodeUtf8IO = try . evaluate . Text.decodeUtf8With Text.strictDecode
κ·Έκ²λ κ°μ λ¬Έμ κ° μμ΅λλ€.
λ°μ : https://stackoverflow.com/questions/31671634/handling-unicode-sequences-in-postgresql
null λ°μ΄νΈλ PostgreSQL λ¬Έμμ΄μμ μ ν¨νμ§ μμ΅λλ€. λ λ€ μ λ‘ μ½λ ν¬μΈνΈκ° μλλλ€.
νμ¬ μ΄κ²μ Haskell/Persistentκ° postgresλ‘ λ³΄λ΄κΈ° μν΄ μ΄κ²μ μ§λ ¬ννλ λ°©μ λλ¬Έμ΄λΌκ³ μκ°ν©λλ€. νμ¬ μ΄ μ΄λ‘ μ κ²μ¦νλ €κ³ λ Έλ ₯νκ³ μμ΅λλ€.
Aeson.encode
μ΄λ―Έ NUL
λ¬Έμλ₯Ό \u0000
μ΄μ€μΌμ΄ν μ²λ¦¬ν λ€μ Persistentκ° κ±°λΆν©λλ€.
μ΄μ λν κΉλν ν΄κ²°μ± μ μ°Ύλ κ²μ μ½μ§ μμ κ²μ λλ€.
λλ μ΄κ²μ μ‘°μ¬νκ³ μμκ³ λ€μ μμ±μ΄ μ μ§λλ κ² κ°μ΅λλ€.
"\u0000\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0003"
λ UTF-8λ‘ κ½€ μ ν¨ν©λλ€. UTF-8μ \u0000
κ° μ§μ ννλλλ‘ νμ©νκΈ° λλ¬Έμ
λλ€.\u0000
νμ©λμ§ μμ΅λλ€ jsonb
κ°λ‘ λ³ν ν μ μκΈ° λλ¬Έμ text
.JSONμΌλ‘ μΈμ½λ©ν λ€μ Text
λ‘ μΈμ½λ©ν λ€μ μλͺ»λ λ¬Έμ μνμ€λ₯Ό κ°μ§νκ³ μλͺ»λ μνμ€κ° ββν¬ν¨λ κ²½μ° JSON κ°μ²΄λ₯Ό κ±°λΆνλ μ μΌν μμ μ루μ
μ
λλ€. λν \u0000
κ° λ΄κ° κ±°λΆν΄μΌ νλ μ μΌν μνμ€μΈμ§ κΆκΈν©λλ€.
λ κ°μ μ΄μ μ μ₯ν μ μμ΅λκΉ? bytea λ° JSON(ν μ€νΈκ° μλ λ¬Έμκ° ν¬ν¨λμ§ μμ κ²½μ°)μ μ¬μ©νμ¬ νμν λͺ¨λ κ²μ μμ λ‘κ² μ¬μ©ν μ μμ΅λλ€.
@erikd \u0000
μ ν μ¬νμ Postgresκ° λ°λ₯΄λ λ€λ₯Έ λͺ¨λ κ·μΉκ³Ό ν¨κ» μ¬κΈ°μ λͺ
ννκ² λͺ
μλμ΄
λμ μΆμνλ₯Ό λ°©μ§νλ €λ©΄ μ νν κ°(μ¬μ©μκ° μ 곡ν λλ‘)μ μ μ₯ν΄μΌ ν©λλ€. μ΄κ²μ λλ΅μ μΌλ‘ μλ μλ―Έλ₯Ό μ μ§νλ blob(= DBμ ꡬ쑰 μμ) λλ JSON λ¬Έμμ΄ κ°μ μλ―Έν©λλ€. μλ₯Ό λ€μ΄ DBμ base64 μΈμ½λ© λ¬Έμμ΄ κ°(λ°λΌμ base64μμ μ€μ κ°μΌλ‘ λ³ννλ μμ).
μμ ν΄κ²° λ°©λ² μμ (Postgresμ μ½μ ν μ μλ λ©νλ°μ΄ν° κ°μ²΄ μμ )μ΄ λ§μ€ν°μ λ³ν©λμμ΅λλ€.
μμ μμ μ΄ μ μ©λ λͺ¨μ΅μ λλ€.
[db-sync-node:Info:37] [2020-09-22 10:19:09.66 UTC] insertShelleyBlock: epoch 84, slot 6060000, block 1816721, hash 3ec15354c53deae4eb26a206cc3185f799e80bd09393f279bce7e53a7d633144
[db-sync-node:Warning:37] [2020-09-22 10:19:24.08 UTC] insertTxMetadata: dropped due to a Unicode NUL character.
[db-sync-node:Warning:37] [2020-09-22 10:19:24.08 UTC] insertTxMetadata: dropped due to a Unicode NUL character.
[db-sync-node:Warning:37] [2020-09-22 10:19:24.10 UTC] insertTxMetadata: dropped due to a Unicode NUL character.
[db-sync-node:Warning:37] [2020-09-22 10:19:24.10 UTC] insertTxMetadata: dropped due to a Unicode NUL character.
[db-sync-node:Info:37] [2020-09-22 10:19:24.93 UTC] insertShelleyBlock: epoch 84, slot 6065000, block 1816973, hash 0ab0dd5c36c6eb480b8bbd05508be952c5ed8597a4e422af25bd80a905a9368d
λμ»€κ° μ리λμλμ§ μ¬λΆ λ° μ리 λ²μ μ 무μμ λκΉ
κ³ μ λμ§λ μμμ§λ§ 5.0.x
( 5.0.2
κΆμ₯)μλ μ λμ½λ NUL
λ¬Έμκ° ν¬ν¨λ tx_metadata
λ₯Ό μμ νμ¬ μ΄ λ¬Έμ λ₯Ό λ°©μ§νλ ν΄κ²° λ°©λ²μ΄ μμ΅λλ€.
κ°μ₯ μ μ©ν λκΈ
μμ μμ μ΄ μ μ©λ λͺ¨μ΅μ λλ€.