Skip to content

[bug]: DB TX retries exceeded during global universe sync #675

Open
@jharveyb

Description

@jharveyb

Background

Describe your issue here.

When running with tapd v0.3.0 and a global sync of all issuances on, I get numerous log messages about DB TX retries due to serialization errors. In some cases, these operations hit the 10 retry limit and cause sync to fail.

I know that for 0.3.1 onwards global sync is not the default, but IMO this is an underlying issue that I think could appear even without global sync.

Your environment

tapcli getinfo                       # version of `tapd`, `lnd`, and network

tapd v0.3.0, lnd v0.17.0, mainnet

uname -mrsv                          # operating system 

debian testing
16-core CPU, NVMe SSD

bitcoind --version || btcd --version # version of `btcd`, `bitcoind`, or other backend

default neutrino backend with a local bitcoind v0.25 peer
  • any other relevant environment details

Steps to reproduce

Tell us how to reproduce this issue. Please provide stacktraces and links to code in question.

Perform global issuance sync with the Lightning Labs default universe, with a fresh tapd.

From the log lines preceding these DB issues, I'm pretty sure this is triggered when multiple large (3000+ leaf) asset groups are being synced, and those proofs are being written to disk. The default batch size here is 200 elements, which can be a max size of at least 200 MiB. Since the sync is parallel, we can have multiple goroutines attempting writes in parallel.

The log lines aren't tagged with a goroutine ID or any way to distinguish writers, but based on the attempt counter it seems like 10+ concurrent writers.

Partial logs, generated with cat tapd.log | rg serializ -C20:

2023-11-06 20:19:47.207 [INF] UNIV: Verifying 1 new proofs for insertion into Universe
2023-11-06 20:19:47.207 [DBG] UNIV: UniverseRoot(issuance-766ca5fe4347d5e2218e90387d813c8959e9eaa20e7d777896d1326bad5581f8): Inserting 1 new leaves (1 of 1)
2023-11-06 20:19:47.207 [INF] UNIV: Verifying 1 new proofs for insertion into Universe
2023-11-06 20:19:47.207 [INF] UNIV: Inserting 0 verified group anchor proofs into Universe
2023-11-06 20:19:47.207 [INF] UNIV: Inserting 0 verified group anchor proofs into Universe
2023-11-06 20:19:47.280 [DBG] UNIV: UniverseRoot(issuance-b20b6dc4436dcbe7b3f4b76ce5210fd1e04accae7d9c7ae47cb1ff91b9bbc3dd): Inserting 1 new leaves (1 of 1)
2023-11-06 20:19:47.280 [INF] UNIV: Verifying 1 new proofs for insertion into Universe
2023-11-06 20:19:47.280 [INF] UNIV: Inserting 0 verified group anchor proofs into Universe
2023-11-06 20:19:47.427 [DBG] UNIV: UniverseRoot(issuance-4187c0032ca29783ec3b6441f1f717192d89f787f4219a58e0e7fd53d959785e): Inserting 1 new leaves (1 of 1)
2023-11-06 20:19:47.427 [INF] UNIV: Verifying 1 new proofs for insertion into Universe
2023-11-06 20:19:47.428 [INF] UNIV: Inserting 0 verified group anchor proofs into Universe
2023-11-06 20:19:47.446 [DBG] UNIV: UniverseRoot(issuance-ed45f2cb29254488c7ccf93231f8937564bd8832d40fea2bd619163b357605db): Inserting 1 new leaves (1 of 1)
2023-11-06 20:19:47.446 [INF] UNIV: Verifying 1 new proofs for insertion into Universe
2023-11-06 20:19:47.446 [INF] UNIV: Inserting 0 verified group anchor proofs into Universe
2023-11-06 20:19:48.184 [DBG] UNIV: UniverseRoot(issuance-87225111b8571dcd09e00116238f61c71091485538801b2d6b6457a75119861e): Inserting 200 new leaves (200 of 3061)
2023-11-06 20:19:48.184 [INF] UNIV: Verifying 200 new proofs for insertion into Universe
2023-11-06 20:19:48.219 [INF] UNIV: Inserting 0 verified group anchor proofs into Universe
2023-11-06 20:19:49.958 [DBG] UNIV: UniverseRoot(issuance-997e28940f643b41a3d937bcc842b01c3ba863d66dbd365db015d62a79dd32fc): Inserting 200 new leaves (200 of 3563)
2023-11-06 20:19:49.958 [INF] UNIV: Verifying 200 new proofs for insertion into Universe
2023-11-06 20:19:50.136 [INF] UNIV: Inserting 0 verified group anchor proofs into Universe
2023-11-06 20:19:51.271 [TRC] TADB: Retrying transaction due to tx serialization error, attempt_number=0, delay=29.907727ms
2023-11-06 20:19:51.337 [TRC] TADB: Retrying transaction due to tx serialization error, attempt_number=0, delay=36.433343ms
2023-11-06 20:19:51.337 [TRC] TADB: Retrying transaction due to tx serialization error, attempt_number=0, delay=32.289439ms
2023-11-06 20:19:51.337 [TRC] TADB: Retrying transaction due to tx serialization error, attempt_number=0, delay=56.356503ms
2023-11-06 20:19:51.337 [TRC] TADB: Retrying transaction due to tx serialization error, attempt_number=0, delay=37.433905ms
2023-11-06 20:19:51.338 [TRC] TADB: Retrying transaction due to tx serialization error, attempt_number=0, delay=53.891183ms
2023-11-06 20:19:51.372 [TRC] TADB: Retrying transaction due to tx serialization error, attempt_number=0, delay=58.653632ms
2023-11-06 20:19:52.227 [TRC] TADB: Retrying transaction due to tx serialization error, attempt_number=0, delay=45.018695ms
2023-11-06 20:19:52.227 [TRC] TADB: Retrying transaction due to tx serialization error, attempt_number=0, delay=20.920387ms
2023-11-06 20:19:52.301 [TRC] TADB: Retrying transaction due to tx serialization error, attempt_number=0, delay=43.033733ms
2023-11-06 20:19:52.399 [DBG] UNIV: Retrieving all keys for Universe: id=issuance-4a0268c6dc8ffe86a441712880eb2089d8564d2bb0026b45a0a7b52a103a9219 (asset_id=0000000000000000000000000000000000000000000000000000000000000000, group_key=bd3f2a315259c9e50e63d5b36daba1c89bf9891707a8b792d34eb4b5bbe177eb, proof_type=issuance)
2023-11-06 20:19:52.399 [TRC] TADB: read leaf keys for issuance-4a0268c6dc8ffe86a441712880eb2089d8564d2bb0026b45a0a7b52a103a9219 (asset_id=0000000000000000000000000000000000000000000000000000000000000000, group_key=bd3f2a315259c9e50e63d5b36daba1c89bf9891707a8b792d34eb4b5bbe177eb, proof_type=issuance) from cache
2023-11-06 20:19:52.399 [TRC] TADB: read leaf keys for issuance-4a0268c6dc8ffe86a441712880eb2089d8564d2bb0026b45a0a7b52a103a9219 (asset_id=0000000000000000000000000000000000000000000000000000000000000000, group_key=bd3f2a315259c9e50e63d5b36daba1c89bf9891707a8b792d34eb4b5bbe177eb, proof_type=issuance) from cache
2023-11-06 20:19:52.401 [DBG] TADB: storing leaf keys for issuance-4a0268c6dc8ffe86a441712880eb2089d8564d2bb0026b45a0a7b52a103a9219 (asset_id=0000000000000000000000000000000000000000000000000000000000000000, group_key=bd3f2a315259c9e50e63d5b36daba1c89bf9891707a8b792d34eb4b5bbe177eb, proof_type=issuance) in cache
2023-11-06 20:19:52.408 [INF] UNIV: UniverseRoot(issuance-4a0268c6dc8ffe86a441712880eb2089d8564d2bb0026b45a0a7b52a103a9219): diff_size=7009
2023-11-06 20:19:52.447 [TRC] TADB: Retrying transaction due to tx serialization error, attempt_number=0, delay=21.372471ms
2023-11-06 20:19:52.469 [TRC] TADB: Retrying transaction due to tx serialization error, attempt_number=0, delay=56.932272ms
2023-11-06 20:19:52.477 [TRC] UNIV: UniverseRoot(issuance-4a0268c6dc8ffe86a441712880eb2089d8564d2bb0026b45a0a7b52a103a9219): diff_size=7009, diff=([]universe.LeafKey) (len=7009 cap=7009) {
 (universe.LeafKey) {
  OutPoint: (wire.OutPoint) 46882e61657947e8b8ea9873032cb49c2752b90a146503bb66708bd5482912e0:0,
  ScriptKey: (*asset.ScriptKey)(0xc0fc4e7450)({
   PubKey: (*secp256k1.PublicKey)(0xc0fce061e0)({
    x: (secp256k1.FieldVal) d0ce99ab6b43d36582d203fa756c0dfd5e465bfd929417894e1df3ff297f993f,
    y: (secp256k1.FieldVal) 8655261b9d023c13c74963f4335201e3e223921bd06602b5dcb15790e83766fe
   }),
   TweakedScriptKey: (*asset.TweakedScriptKey)(<nil>)
  })
 },
 (universe.LeafKey) {
  OutPoint: (wire.OutPoint) 46882e61657947e8b8ea9873032cb49c2752b90a146503bb66708bd5482912e0:0,
  ScriptKey: (*asset.ScriptKey)(0xc0e87e6250)({
   PubKey: (*secp256k1.PublicKey)(0xc0e87e51d0)({
    x: (secp256k1.FieldVal) 5e946023dfb19a19a6093d3616542fafa1ce94416eaf1e9e73893d5f14219b5f,
    y: (secp256k1.FieldVal) c0da7c834b376b45b4312a3c477bc29daf7d335db29ddea20496f568376a7b4e
   }),
   TweakedScriptKey: (*asset.TweakedScriptKey)(<nil>)
  })
--
  ScriptKey: (*asset.ScriptKey)(0xc0f4e6b440)({
   PubKey: (*secp256k1.PublicKey)(0xc0f4e77d10)({
    x: (secp256k1.FieldVal) 12b3798c5359e6f5cb0363c2414ace6b45a98a973c0f08d075e5234297558f63,
    y: (secp256k1.FieldVal) 7212665e5321059577bb3267a6d10a6f39108eb756a40e4170acac9de61cd27e
   }),
   TweakedScriptKey: (*asset.TweakedScriptKey)(<nil>)
  })
 },
 (universe.LeafKey) {
  OutPoint: (wire.OutPoint) 46882e61657947e8b8ea9873032cb49c2752b90a146503bb66708bd5482912e0:0,
  ScriptKey: (*asset.ScriptKey)(0xc0da3b7450)({
   PubKey: (*secp256k1.PublicKey)(0xc0da6d9b80)({
    x: (secp256k1.FieldVal) 105f982871162c42acab71846ced75ea9b09d16c9244593a83b98b0e842ff64e,
    y: (secp256k1.FieldVal) 2b491834718381bfd0c5f6221d808cdb50b1c8320a0bac896010166fcb162aa0
   }),
   TweakedScriptKey: (*asset.TweakedScriptKey)(<nil>)
  })
 }
}

2023-11-06 20:19:53.239 [TRC] TADB: Retrying transaction due to tx serialization error, attempt_number=0, delay=34.58017ms
2023-11-06 20:19:55.160 [TRC] TADB: Retrying transaction due to tx serialization error, attempt_number=0, delay=55.545068ms
2023-11-06 20:19:56.321 [TRC] TADB: Retrying transaction due to tx serialization error, attempt_number=1, delay=44.909096ms
2023-11-06 20:19:56.391 [TRC] TADB: Retrying transaction due to tx serialization error, attempt_number=1, delay=105.512892ms
2023-11-06 20:19:56.397 [TRC] TADB: Retrying transaction due to tx serialization error, attempt_number=1, delay=69.279688ms
2023-11-06 20:19:56.397 [TRC] TADB: Retrying transaction due to tx serialization error, attempt_number=1, delay=56.755296ms
2023-11-06 20:19:56.417 [TRC] TADB: Retrying transaction due to tx serialization error, attempt_number=1, delay=88.2829ms
2023-11-06 20:19:56.417 [TRC] TADB: Retrying transaction due to tx serialization error, attempt_number=1, delay=117.399398ms
2023-11-06 20:19:56.448 [TRC] TADB: Retrying transaction due to tx serialization error, attempt_number=1, delay=107.067598ms
2023-11-06 20:19:57.270 [TRC] TADB: Retrying transaction due to tx serialization error, attempt_number=1, delay=106.008438ms
2023-11-06 20:19:57.297 [TRC] TADB: Retrying transaction due to tx serialization error, attempt_number=1, delay=118.682018ms
2023-11-06 20:19:57.370 [TRC] TADB: Retrying transaction due to tx serialization error, attempt_number=1, delay=81.688782ms
2023-11-06 20:19:57.487 [TRC] TADB: Retrying transaction due to tx serialization error, attempt_number=1, delay=99.339766ms
2023-11-06 20:19:57.549 [TRC] TADB: Retrying transaction due to tx serialization error, attempt_number=1, delay=113.995154ms
2023-11-06 20:19:58.301 [TRC] TADB: Retrying transaction due to tx serialization error, attempt_number=1, delay=68.57312ms
2023-11-06 20:20:00.238 [TRC] TADB: Retrying transaction due to tx serialization error, attempt_number=1, delay=47.548954ms
2023-11-06 20:20:01.387 [TRC] TADB: Retrying transaction due to tx serialization error, attempt_number=2, delay=179.370136ms
2023-11-06 20:20:01.474 [TRC] TADB: Retrying transaction due to tx serialization error, attempt_number=2, delay=156.946432ms
2023-11-06 20:20:01.490 [TRC] TADB: Retrying transaction due to tx serialization error, attempt_number=2, delay=232.77266ms
2023-11-06 20:20:01.519 [TRC] TADB: Retrying transaction due to tx serialization error, attempt_number=2, delay=166.662352ms
2023-11-06 20:20:01.526 [TRC] TADB: Retrying transaction due to tx serialization error, attempt_number=2, delay=183.145452ms
2023-11-06 20:20:01.552 [TRC] TADB: Retrying transaction due to tx serialization error, attempt_number=2, delay=100.413336ms
2023-11-06 20:20:01.575 [TRC] TADB: Retrying transaction due to tx serialization error, attempt_number=2, delay=212.815388ms
2023-11-06 20:20:02.400 [TRC] TADB: Retrying transaction due to tx serialization error, attempt_number=2, delay=167.879132ms
2023-11-06 20:20:02.437 [TRC] TADB: Retrying transaction due to tx serialization error, attempt_number=2, delay=114.905652ms
2023-11-06 20:20:02.476 [TRC] TADB: Retrying transaction due to tx serialization error, attempt_number=2, delay=123.79096ms
2023-11-06 20:20:02.614 [TRC] TADB: Retrying transaction due to tx serialization error, attempt_number=2, delay=179.375468ms
2023-11-06 20:20:02.687 [TRC] TADB: Retrying transaction due to tx serialization error, attempt_number=2, delay=219.525108ms
2023-11-06 20:20:03.388 [TRC] TADB: Retrying transaction due to tx serialization error, attempt_number=2, delay=235.781132ms
2023-11-06 20:20:05.310 [TRC] TADB: Retrying transaction due to tx serialization error, attempt_number=2, delay=218.823388ms
2023-11-06 20:20:06.590 [TRC] TADB: Retrying transaction due to tx serialization error, attempt_number=3, delay=356.327024ms
2023-11-06 20:20:06.651 [TRC] TADB: Retrying transaction due to tx serialization error, attempt_number=3, delay=230.183ms
2023-11-06 20:20:06.672 [TRC] TADB: Retrying transaction due to tx serialization error, attempt_number=3, delay=406.828168ms
2023-11-06 20:20:06.708 [TRC] TADB: Retrying transaction due to tx serialization error, attempt_number=3, delay=213.49792ms
2023-11-06 20:20:06.732 [TRC] TADB: Retrying transaction due to tx serialization error, attempt_number=3, delay=358.046248ms
2023-11-06 20:20:06.744 [TRC] TADB: Retrying transaction due to tx serialization error, attempt_number=3, delay=240.036744ms
2023-11-06 20:20:06.810 [TRC] TADB: Retrying transaction due to tx serialization error, attempt_number=3, delay=279.398936ms
2023-11-06 20:20:07.575 [TRC] TADB: Retrying transaction due to tx serialization error, attempt_number=3, delay=333.480688ms
2023-11-06 20:20:07.593 [TRC] TADB: Retrying transaction due to tx serialization error, attempt_number=3, delay=317.983704ms
2023-11-06 20:20:07.621 [TRC] TADB: Retrying transaction due to tx serialization error, attempt_number=3, delay=242.748576ms
2023-11-06 20:20:07.812 [TRC] TADB: Retrying transaction due to tx serialization error, attempt_number=3, delay=430.281808ms
2023-11-06 20:20:07.928 [TRC] TADB: Retrying transaction due to tx serialization error, attempt_number=3, delay=182.745536ms
2023-11-06 20:20:08.642 [TRC] TADB: Retrying transaction due to tx serialization error, attempt_number=3, delay=221.837296ms
2023-11-06 20:20:10.548 [TRC] TADB: Retrying transaction due to tx serialization error, attempt_number=3, delay=194.558296ms
2023-11-06 20:20:11.901 [TRC] TADB: Retrying transaction due to tx serialization error, attempt_number=4, delay=757.435872ms
2023-11-06 20:20:11.943 [TRC] TADB: Retrying transaction due to tx serialization error, attempt_number=4, delay=485.486208ms
2023-11-06 20:20:11.965 [TRC] TADB: Retrying transaction due to tx serialization error, attempt_number=4, delay=381.838208ms
2023-11-06 20:20:12.001 [TRC] TADB: Retrying transaction due to tx serialization error, attempt_number=4, delay=811.882912ms
2023-11-06 20:20:12.101 [TRC] TADB: Retrying transaction due to tx serialization error, attempt_number=4, delay=321.2524ms
2023-11-06 20:20:12.110 [TRC] TADB: Retrying transaction due to tx serialization error, attempt_number=4, delay=632.23112ms
2023-11-06 20:20:12.110 [TRC] TADB: Retrying transaction due to tx serialization error, attempt_number=4, delay=791.195968ms
2023-11-06 20:20:12.887 [TRC] TADB: Retrying transaction due to tx serialization error, attempt_number=4, delay=867.200096ms
2023-11-06 20:20:12.930 [TRC] TADB: Retrying transaction due to tx serialization error, attempt_number=4, delay=591.273376ms
2023-11-06 20:20:12.930 [TRC] TADB: Retrying transaction due to tx serialization error, attempt_number=4, delay=936.084ms
2023-11-06 20:20:13.132 [TRC] TADB: Retrying transaction due to tx serialization error, attempt_number=4, delay=812.571488ms
2023-11-06 20:20:13.263 [TRC] TADB: Retrying transaction due to tx serialization error, attempt_number=4, delay=770.6852ms
2023-11-06 20:20:13.882 [TRC] TADB: Retrying transaction due to tx serialization error, attempt_number=4, delay=476.062464ms
2023-11-06 20:20:15.765 [TRC] TADB: Retrying transaction due to tx serialization error, attempt_number=4, delay=502.599744ms
2023-11-06 20:20:17.370 [TRC] TADB: Retrying transaction due to tx serialization error, attempt_number=5, delay=801.898112ms
2023-11-06 20:20:17.444 [TRC] TADB: Retrying transaction due to tx serialization error, attempt_number=5, delay=1.359726144s
2023-11-06 20:20:17.447 [TRC] TADB: Retrying transaction due to tx serialization error, attempt_number=5, delay=1.440657024s
2023-11-06 20:20:17.678 [TRC] TADB: Retrying transaction due to tx serialization error, attempt_number=5, delay=1.531987936s
2023-11-06 20:20:17.763 [TRC] TADB: Retrying transaction due to tx serialization error, attempt_number=5, delay=1.520366688s
2023-11-06 20:20:17.831 [TRC] TADB: Retrying transaction due to tx serialization error, attempt_number=5, delay=724.990592ms
2023-11-06 20:20:17.925 [TRC] TADB: Retrying transaction due to tx serialization error, attempt_number=5, delay=1.034333952s
2023-11-06 20:20:18.543 [TRC] TADB: Retrying transaction due to tx serialization error, attempt_number=5, delay=1.440540992s
2023-11-06 20:20:18.775 [TRC] TADB: Retrying transaction due to tx serialization error, attempt_number=5, delay=973.886432ms
2023-11-06 20:20:18.885 [TRC] TADB: Retrying transaction due to tx serialization error, attempt_number=5, delay=1.7360704s
2023-11-06 20:20:18.968 [TRC] TADB: Retrying transaction due to tx serialization error, attempt_number=5, delay=1.297001632s
2023-11-06 20:20:19.056 [TRC] TADB: Retrying transaction due to tx serialization error, attempt_number=5, delay=794.894272ms
2023-11-06 20:20:19.381 [TRC] TADB: Retrying transaction due to tx serialization error, attempt_number=5, delay=1.46788304s
2023-11-06 20:20:21.286 [TRC] TADB: Retrying transaction due to tx serialization error, attempt_number=5, delay=947.981536ms
2023-11-06 20:20:23.190 [TRC] TADB: Retrying transaction due to tx serialization error, attempt_number=6, delay=2.68142144s
2023-11-06 20:20:23.577 [TRC] TADB: Retrying transaction due to tx serialization error, attempt_number=6, delay=3s
2023-11-06 20:20:23.824 [TRC] TADB: Retrying transaction due to tx serialization error, attempt_number=6, delay=1.721666304s
2023-11-06 20:20:23.908 [TRC] TADB: Retrying transaction due to tx serialization error, attempt_number=6, delay=3s
2023-11-06 20:20:23.978 [TRC] TADB: Retrying transaction due to tx serialization error, attempt_number=6, delay=3s
2023-11-06 20:20:24.230 [TRC] TADB: Retrying transaction due to tx serialization error, attempt_number=6, delay=1.602506752s
2023-11-06 20:20:24.299 [TRC] TADB: Retrying transaction due to tx serialization error, attempt_number=6, delay=2.175833536s
2023-11-06 20:20:24.771 [TRC] TADB: Retrying transaction due to tx serialization error, attempt_number=6, delay=2.308415936s
2023-11-06 20:20:24.871 [TRC] TADB: Retrying transaction due to tx serialization error, attempt_number=6, delay=1.74248992s
2023-11-06 20:20:25.002 [TRC] TADB: Retrying transaction due to tx serialization error, attempt_number=6, delay=3s
2023-11-06 20:20:25.284 [TRC] TADB: Retrying transaction due to tx serialization error, attempt_number=6, delay=2.255631872s
2023-11-06 20:20:25.638 [TRC] TADB: Retrying transaction due to tx serialization error, attempt_number=6, delay=2.45642432s
2023-11-06 20:20:25.867 [TRC] TADB: Retrying transaction due to tx serialization error, attempt_number=6, delay=3s
2023-11-06 20:20:27.254 [TRC] TADB: Retrying transaction due to tx serialization error, attempt_number=6, delay=1.605380928s
2023-11-06 20:20:30.561 [TRC] TADB: Retrying transaction due to tx serialization error, attempt_number=7, delay=3s
2023-11-06 20:20:30.850 [TRC] TADB: Retrying transaction due to tx serialization error, attempt_number=7, delay=3s
2023-11-06 20:20:30.892 [TRC] TADB: Retrying transaction due to tx serialization error, attempt_number=7, delay=3s
2023-11-06 20:20:31.495 [TRC] TADB: Retrying transaction due to tx serialization error, attempt_number=7, delay=3s
2023-11-06 20:20:31.598 [TRC] TADB: Retrying transaction due to tx serialization error, attempt_number=7, delay=3s
2023-11-06 20:20:31.635 [TRC] TADB: Retrying transaction due to tx serialization error, attempt_number=7, delay=3s
2023-11-06 20:20:31.926 [TRC] TADB: Retrying transaction due to tx serialization error, attempt_number=7, delay=3s
2023-11-06 20:20:31.997 [TRC] TADB: Retrying transaction due to tx serialization error, attempt_number=7, delay=3s
2023-11-06 20:20:32.100 [TRC] TADB: Retrying transaction due to tx serialization error, attempt_number=7, delay=3s
2023-11-06 20:20:32.556 [TRC] TADB: Retrying transaction due to tx serialization error, attempt_number=7, delay=3s
2023-11-06 20:20:33.020 [TRC] TADB: Retrying transaction due to tx serialization error, attempt_number=7, delay=2.839809408s
2023-11-06 20:20:33.114 [TRC] TADB: Retrying transaction due to tx serialization error, attempt_number=7, delay=3s
2023-11-06 20:20:33.879 [TRC] TADB: Retrying transaction due to tx serialization error, attempt_number=7, delay=3s
2023-11-06 20:20:33.885 [TRC] TADB: Retrying transaction due to tx serialization error, attempt_number=7, delay=3s
2023-11-06 20:20:34.500 [DBG] UNIV: UniverseRoot(issuance-4a0268c6dc8ffe86a441712880eb2089d8564d2bb0026b45a0a7b52a103a9219): Inserting 200 new leaves (200 of 7009)
2023-11-06 20:20:34.500 [INF] UNIV: Verifying 200 new proofs for insertion into Universe
2023-11-06 20:20:34.535 [INF] UNIV: Inserting 0 verified group anchor proofs into Universe
2023-11-06 20:20:38.582 [TRC] TADB: Retrying transaction due to tx serialization error, attempt_number=8, delay=3s
2023-11-06 20:20:38.876 [TRC] TADB: Retrying transaction due to tx serialization error, attempt_number=8, delay=3s
2023-11-06 20:20:38.912 [TRC] TADB: Retrying transaction due to tx serialization error, attempt_number=8, delay=3s
2023-11-06 20:20:39.516 [TRC] TADB: Retrying transaction due to tx serialization error, attempt_number=8, delay=3s
2023-11-06 20:20:39.554 [TRC] TADB: Retrying transaction due to tx serialization error, attempt_number=0, delay=28.870458ms
2023-11-06 20:20:39.620 [TRC] TADB: Retrying transaction due to tx serialization error, attempt_number=8, delay=3s
2023-11-06 20:20:39.654 [TRC] TADB: Retrying transaction due to tx serialization error, attempt_number=8, delay=3s
2023-11-06 20:20:39.954 [TRC] TADB: Retrying transaction due to tx serialization error, attempt_number=8, delay=3s
2023-11-06 20:20:40.019 [TRC] TADB: Retrying transaction due to tx serialization error, attempt_number=8, delay=3s
2023-11-06 20:20:40.120 [TRC] TADB: Retrying transaction due to tx serialization error, attempt_number=8, delay=3s
2023-11-06 20:20:40.581 [TRC] TADB: Retrying transaction due to tx serialization error, attempt_number=8, delay=3s
2023-11-06 20:20:40.882 [TRC] TADB: Retrying transaction due to tx serialization error, attempt_number=8, delay=3s
2023-11-06 20:20:41.130 [TRC] TADB: Retrying transaction due to tx serialization error, attempt_number=8, delay=3s
2023-11-06 20:20:41.907 [TRC] TADB: Retrying transaction due to tx serialization error, attempt_number=8, delay=3s
2023-11-06 20:20:41.907 [TRC] TADB: Retrying transaction due to tx serialization error, attempt_number=8, delay=3s
2023-11-06 20:20:44.603 [TRC] TADB: Retrying transaction due to tx serialization error, attempt_number=1, delay=80.4357ms
2023-11-06 20:20:46.604 [TRC] TADB: Retrying transaction due to tx serialization error, attempt_number=9, delay=3s
2023-11-06 20:20:46.900 [TRC] TADB: Retrying transaction due to tx serialization error, attempt_number=9, delay=3s
2023-11-06 20:20:46.940 [TRC] TADB: Retrying transaction due to tx serialization error, attempt_number=9, delay=3s
2023-11-06 20:20:47.543 [TRC] TADB: Retrying transaction due to tx serialization error, attempt_number=9, delay=3s
2023-11-06 20:20:47.643 [TRC] TADB: Retrying transaction due to tx serialization error, attempt_number=9, delay=3s
2023-11-06 20:20:47.673 [TRC] TADB: Retrying transaction due to tx serialization error, attempt_number=9, delay=3s
2023-11-06 20:20:47.974 [TRC] TADB: Retrying transaction due to tx serialization error, attempt_number=9, delay=3s
2023-11-06 20:20:48.039 [TRC] TADB: Retrying transaction due to tx serialization error, attempt_number=9, delay=3s
2023-11-06 20:20:48.145 [TRC] TADB: Retrying transaction due to tx serialization error, attempt_number=9, delay=3s
2023-11-06 20:20:48.605 [TRC] TADB: Retrying transaction due to tx serialization error, attempt_number=9, delay=3s
2023-11-06 20:20:48.907 [TRC] TADB: Retrying transaction due to tx serialization error, attempt_number=9, delay=3s
2023-11-06 20:20:49.153 [TRC] TADB: Retrying transaction due to tx serialization error, attempt_number=9, delay=3s
2023-11-06 20:20:49.605 [DBG] UNIV: Looking up root node for base Universe (universe.Identifier) issuance-5066057bb5b507aff4a5710c19b9394ebff9b039305ba7cc5489f3c769667f7f

2023-11-06 20:20:49.605 [DBG] UNIV: Looking up root node for base Universe (universe.Identifier) issuance-9a7af6a2f6783877d11a39ff3dfeaa04f3d6bc965dc9ad04d4e59cbc09af9276

2023-11-06 20:20:49.605 [DBG] UNIV: Looking up root node for base Universe (universe.Identifier) issuance-286f01a99855d7bc5dd4d875bce185d6acb1e9ba3acb9eec0085ce13620b4086

2023-11-06 20:20:49.605 [DBG] UNIV: Looking up root node for base Universe (universe.Identifier) issuance-183247544f121f9d834b8be25bb02bedd62dbb1b43f541b447f6838dc1043719

2023-11-06 20:20:49.605 [DBG] UNIV: Looking up root node for base Universe (universe.Identifier) issuance-f0a17e8c81f27097a95a7ea591072abba67260d3d0c5631876915b9666c40630

2023-11-06 20:20:49.605 [DBG] UNIV: Looking up root node for base Universe (universe.Identifier) issuance-1142a81e275bbfe7e43c3b271dff190b9eb3760f4564a35d9b772186230c3747

2023-11-06 20:20:49.605 [DBG] UNIV: Looking up root node for base Universe (universe.Identifier) issuance-6ff765342e57468496594cf8f5220c400ef2a0b6633b8b09728dec1d93389201

2023-11-06 20:20:49.606 [DBG] UNIV: Looking up root node for base Universe (universe.Identifier) issuance-8ecbab5714b3559cf72a63d4ba61767aeff64e3587a8fa8350af9d1200f699cf

2023-11-06 20:20:49.606 [DBG] UNIV: Looking up root node for base Universe (universe.Identifier) issuance-42557cc5f390f5029f4adf586406117097b02de513c8041adfc6bced3b17a8cf

2023-11-06 20:20:49.606 [DBG] UNIV: Looking up root node for base Universe (universe.Identifier) issuance-b38246163381af3f08091d7fa9b59a28d96b3c3ed05ddcded40000f6558b3736

--

2023-11-06 20:20:49.656 [DBG] UNIV: Looking up root node for base Universe (universe.Identifier) issuance-85eedf70ce32b038ce16a0a8df202d68445fe27d81465949618a582a963be320

2023-11-06 20:20:49.656 [DBG] UNIV: Looking up root node for base Universe (universe.Identifier) issuance-7e3ccdf93124041ea6ee3a0d57da789ae90668942d95edf3d1d1a57824eae43a

2023-11-06 20:20:49.656 [DBG] UNIV: Looking up root node for base Universe (universe.Identifier) issuance-7651bbb2ae97822d1de2669371cc03684713945f0d0211404217f261511a91f6

2023-11-06 20:20:49.656 [DBG] UNIV: Looking up root node for base Universe (universe.Identifier) issuance-09ee8de973e2a6a02b39f46be0b388100ce791115a4076847a679a6992de977b

2023-11-06 20:20:49.656 [DBG] UNIV: Looking up root node for base Universe (universe.Identifier) issuance-766e6b5243401c08285749ec625672ffb1215168e8c626ee3c8bee9933899437

2023-11-06 20:20:49.656 [DBG] UNIV: Looking up root node for base Universe (universe.Identifier) issuance-cc32551a1c20071ccaa76155b1718cb6d991a116f05b76c279a2476fc9ecb8f7

2023-11-06 20:20:49.656 [DBG] UNIV: Looking up root node for base Universe (universe.Identifier) issuance-f0896a50b538937618cdfeb9836d638b4d404c3df43af2d5d93a524582e93ac0

2023-11-06 20:20:49.656 [INF] TADB: db cache universe_roots: 10112 hits, 678588 misses, 1.47% hit ratio
2023-11-06 20:20:49.656 [DBG] UNIV: Looking up root node for base Universe (universe.Identifier) issuance-351cb88f7a7595d152bcfb5babe0424bb0537162d97f9f2b01d2e87252d1f6c0

2023-11-06 20:20:49.656 [DBG] UNIV: Looking up root node for base Universe (universe.Identifier) issuance-3cf95e407d5ec74a0a8635a6e385cdcf1e3ca921a209cdcc292dec969c698a7a

2023-11-06 20:20:49.709 [TRC] TADB: Retrying transaction due to tx serialization error, attempt_number=2, delay=86.1926ms
2023-11-06 20:20:49.926 [TRC] TADB: Retrying transaction due to tx serialization error, attempt_number=9, delay=3s
2023-11-06 20:20:52.154 [WRN] UNIV: encountered an error whilst syncing with server=(universe.ServerAddr) {
 ID: (int64) 1,
 addrStr: (string) (len=32) "universe.lightning.finance:10029",
 addr: (net.Addr) <nil>
}
: %!w(*fmt.wrapError=&{unable to register proofs: unable to register proofs: unable to register new group anchor issuance proofs: db tx retries exceeded 0xc0fa49a480})
2023-11-06 20:21:03.368 [INF] TAPD: Received shutdown request.
2023-11-06 20:21:03.368 [INF] TAPD: Shutting down...
2023-11-06 20:21:03.368 [INF] TAPD: Gracefully shutting down.
2023-11-06 20:21:03.368 [INF] SRVR: Received SIGINT (Ctrl+C). Shutting down...
2023-11-06 20:21:03.368 [INF] RPCS: Stopping RPC Server
2023-11-06 20:21:03.369 [INF] SRVR: Shutdown complete

Possible fixes

I expect most end users with smaller wallets (not universe operators, companies running larger nodes) with run with the defaults and on an SQLite backend.

We could decrease the default DB write batch size, or the # of parallel goroutines during sync.

Alternatively, we could add another synchronization layer between concurrent DB writers like a counting semaphore to rate-limit DB access but still have many goroutines for the other work performed during sync.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    🏗 In progress

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions