osmith has submitted this change. ( https://gerrit.osmocom.org/c/osmo-hlr/+/39804?usp=email )
Change subject: db: flush after changing schema version
......................................................................
db: flush after changing schema version
Flush the cache after changing the version, to make the scenario less
likely that after an unclean shutdown the DB gets restored with the
right table layout but wrong version.
When that happens, osmo-hlr tries to upgrade the database layout again
and fails with errors like "duplicate column name".
Related: SYS#7394
Change-Id: I5943a1cb3447c038c6e7972f68f9656b73a9248b
---
M src/db.c
1 file changed, 9 insertions(+), 0 deletions(-)
Approvals:
fixeria: Looks good to me, approved
Jenkins Builder: Verified
pespin: Looks good to me, but someone else must approve
diff --git a/src/db.c b/src/db.c
index 7b8a415..4ce5aa0 100644
--- a/src/db.c
+++ b/src/db.c
@@ -595,6 +595,7 @@
int rc;
bool has_sqlite_config_sqllog = false;
int version;
+ bool version_changed = false;
LOGP(DDB, LOGL_NOTICE, "using database: %s\n", fname);
LOGP(DDB, LOGL_INFO, "Compiled against SQLite3 lib version %s\n", SQLITE_VERSION);
@@ -672,6 +673,7 @@
goto out_free;
}
version = CURRENT_SCHEMA_VERSION;
+ version_changed = true;
}
LOGP(DDB, LOGL_NOTICE, "Database '%s' has HLR DB schema version %d\n", dbc->fname, version);
@@ -686,6 +688,7 @@
}
LOGP(DDB, LOGL_NOTICE, "Database '%s' has been upgraded to HLR DB schema version %d\n",
dbc->fname, version+1);
+ version_changed = true;
}
if (version != CURRENT_SCHEMA_VERSION) {
@@ -702,6 +705,12 @@
goto out_free;
}
+ /* Flush the cache after changing the version, to make the scenario
+ * less likely that after an unclean shutdown the DB gets restored
+ * with the right table layout but wrong version (SYS#7394). */
+ if (version_changed)
+ sqlite3_db_cacheflush(dbc->db);
+
/* prepare all SQL statements */
for (i = 0; i < ARRAY_SIZE(dbc->stmt); i++) {
rc = sqlite3_prepare_v2(dbc->db, stmt_sql[i], -1,
--
To view, visit https://gerrit.osmocom.org/c/osmo-hlr/+/39804?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: osmo-hlr
Gerrit-Branch: master
Gerrit-Change-Id: I5943a1cb3447c038c6e7972f68f9656b73a9248b
Gerrit-Change-Number: 39804
Gerrit-PatchSet: 2
Gerrit-Owner: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Attention is currently required from: osmith.
fixeria has posted comments on this change by osmith. ( https://gerrit.osmocom.org/c/osmo-hlr/+/39804?usp=email )
Change subject: db: flush after changing schema version
......................................................................
Patch Set 2: Code-Review+2
--
To view, visit https://gerrit.osmocom.org/c/osmo-hlr/+/39804?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: osmo-hlr
Gerrit-Branch: master
Gerrit-Change-Id: I5943a1cb3447c038c6e7972f68f9656b73a9248b
Gerrit-Change-Number: 39804
Gerrit-PatchSet: 2
Gerrit-Owner: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: osmith <osmith(a)sysmocom.de>
Gerrit-Comment-Date: Tue, 18 Mar 2025 08:47:18 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Attention is currently required from: fixeria.
pespin has posted comments on this change by fixeria. ( https://gerrit.osmocom.org/c/osmocom-bb/+/39813?usp=email )
Change subject: trx_toolkit: implement sending of NOPE.ind
......................................................................
Patch Set 1: Code-Review+1
--
To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/39813?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Change-Id: I1e1a5209a9acff6c747cb4c574e9118bc8268474
Gerrit-Change-Number: 39813
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Comment-Date: Mon, 17 Mar 2025 20:49:37 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Attention is currently required from: fixeria.
pespin has posted comments on this change by fixeria. ( https://gerrit.osmocom.org/c/osmocom-bb/+/39814?usp=email )
Change subject: Revert "trxcon/trx_if: send NOPE indications if there is no burst"
......................................................................
Patch Set 1: Code-Review+1
(1 comment)
File src/host/trxcon/src/trx_if.c:
https://gerrit.osmocom.org/c/osmocom-bb/+/39814/comment/ccdee3f9_4d966d51?u… :
PS1, Line 724: if (br->burst_len == 0)
A comment here describing that this is NOPE.ind may be really interesting.
--
To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/39814?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Change-Id: Ic3c55511cfee911d4eaea0ab19ee6295c9ac28cc
Gerrit-Change-Number: 39814
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Comment-Date: Mon, 17 Mar 2025 20:47:59 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmocom-bb/+/39814?usp=email )
Change subject: Revert "trxcon/trx_if: send NOPE indications if there is no burst"
......................................................................
Revert "trxcon/trx_if: send NOPE indications if there is no burst"
This reverts commit f8bc28505f60e2a5636ad7779a13374ed661ad14.
Sending NOPE.ind from trxcon is no longer needed, since fake_trx.py
can now generate them on its own (see the related commit).
Change-Id: Ic3c55511cfee911d4eaea0ab19ee6295c9ac28cc
Related: I1e1a5209a9acff6c747cb4c574e9118bc8268474
---
M src/host/trxcon/src/trx_if.c
1 file changed, 5 insertions(+), 4 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/14/39814/1
diff --git a/src/host/trxcon/src/trx_if.c b/src/host/trxcon/src/trx_if.c
index fad1026..e23b71a 100644
--- a/src/host/trxcon/src/trx_if.c
+++ b/src/host/trxcon/src/trx_if.c
@@ -721,6 +721,9 @@
uint8_t buf[TRXD_BUF_SIZE];
size_t length;
+ if (br->burst_len == 0)
+ return 0;
+
/**
* We must be sure that we have clock,
* and we have sent all control data
@@ -746,10 +749,8 @@
length = 6;
/* Copy ubits {0,1} */
- if (br->burst_len != 0) {
- memcpy(buf + 6, br->burst, br->burst_len);
- length += br->burst_len;
- }
+ memcpy(buf + 6, br->burst, br->burst_len);
+ length += br->burst_len;
/* Send data to transceiver */
send(trx->trx_ofd_data.fd, buf, length, 0);
--
To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/39814?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Change-Id: Ic3c55511cfee911d4eaea0ab19ee6295c9ac28cc
Gerrit-Change-Number: 39814
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmocom-bb/+/39813?usp=email )
Change subject: trx_toolkit: implement sending of NOPE.ind
......................................................................
trx_toolkit: implement sending of NOPE.ind
Now that we have the transmit burst queue properly working, we can
finally emit NOPE.ind from fake_trx.py. There's no more need to
rely on trxcon sending NOPE.ind, so the respective logic will be
reverted in a follow-up patch.
Change-Id: I1e1a5209a9acff6c747cb4c574e9118bc8268474
---
M src/target/trx_toolkit/transceiver.py
1 file changed, 6 insertions(+), 2 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/13/39813/1
diff --git a/src/target/trx_toolkit/transceiver.py b/src/target/trx_toolkit/transceiver.py
index ce71bb1..a5298b4 100644
--- a/src/target/trx_toolkit/transceiver.py
+++ b/src/target/trx_toolkit/transceiver.py
@@ -23,6 +23,7 @@
from ctrl_if_trx import CTRLInterfaceTRX
from data_if import DATAInterface
+from data_msg import TxMsg
from udp_link import UDPLink
from trx_list import TRXList
@@ -308,8 +309,11 @@
if not self.running:
return
+ # list of PDUs to be dropped
drop = []
- emit = []
+ # list of PDUs to be emitted (all NOPE.ind by default)
+ emit = [TxMsg(fn, tn) for tn in range(8)]
+ # list of PDUs to be kept in the Tx queue
wait = []
with self._tx_queue_lock:
@@ -317,7 +321,7 @@
if msg.fn < fn:
drop.append(msg)
elif msg.fn == fn:
- emit.append(msg)
+ emit[msg.tn] = msg
else:
wait.append(msg)
--
To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/39813?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Change-Id: I1e1a5209a9acff6c747cb4c574e9118bc8268474
Gerrit-Change-Number: 39813
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
pespin has posted comments on this change by pespin. ( https://gerrit.osmocom.org/c/libosmocore/+/39812?usp=email )
Change subject: lapdm: Move queue initialization to specific init function
......................................................................
Patch Set 2:
(1 comment)
Commit Message:
https://gerrit.osmocom.org/c/libosmocore/+/39812/comment/8cba746e_082d0e85?… :
PS1, Line 9: Otherwise the msg talloc reference is kept parented at some unknown
: pointer in some unknown upper layer, which may cause memory corruption
: or
> This does not belong here.
Done
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/39812?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I9c73f3aa5cc39d298296a82a99fbaf234b0ebe99
Gerrit-Change-Number: 39812
Gerrit-PatchSet: 2
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Mon, 17 Mar 2025 18:14:06 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: fixeria <vyanitskiy(a)sysmocom.de>