Commit 9152bab
committed
exmdb: cure double notification of content table additions
Under these conditions combined:
* MAPI client has a content table open on a folder
* The MAPI content table has a sort order defined
(this causes a UNIQUE index to be added to the sqlite table)
* Message delivery executes an OP_MOVE rule to the same folder
* Twostep Rule Processor is used
then the following log message is observed:
```
sqlite3_exec(tables.sqlite3) "INSERT INTO t8 (inst_id, prev_id, row_type,
depth, inst_num, idx) VALUES (2097156, 1, 2, 0, 0, 2)": UNIQUE constraint
failed: t8.inst_id (19) at [...]"
```
maps to
[/usr/src/debug/gromox-2.46.20.bac7ae5-lp156.2.1.x86_64
exch/exmdb/db_engine.hpp:208
exch/exmdb/db_engine.cpp:2122 void db_conn::notify_new_mail last line
exch/exmdb/store2.cpp:68 (discriminator 6)
include/exmdb_dispatch.cpp:962
]
When a *categorized* sort order is set, the message is slightly
different:
```
sqlite3_step(tables.sqlite3) "INSERT INTO t29 (inst_id, row_type,
row_stat, parent_id, depth, count, unread, inst_num, value, extremum,
prev_id) VALUES (2097158, 2, NULL, 1, 1, NULL, NULL, 0, NULL, 0,
-1)": UNIQUE constraint failed: t29.inst_id (19)
```
(no backtrace)
cttbl_add_row is called from both notify_new_mail and
notify_message_movecopy.
[Onestep Rule Processor does not exhibit the problem because it uses
cu_copy_message rather than exmdb_server::movecopy_messages, not
generating notifications.]
The fix here appears to be to use the transport_new_mail EXRPC
instead of notify_new_mail, to eschew the extra call to
cttbl_add_row. In addition, deliver_message (which runs in any case)
should emit the message_created notification ahead of the OP_MOVE.
References: DESK-35191 parent 7263fd1 commit 9152bab
File tree
5 files changed
+43
-26
lines changed- doc
- exch/exmdb
- lib
5 files changed
+43
-26
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
24 | 26 | | |
25 | 27 | | |
26 | 28 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
553 | 553 | | |
554 | 554 | | |
555 | 555 | | |
556 | | - | |
| 556 | + | |
557 | 557 | | |
558 | 558 | | |
559 | 559 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2929 | 2929 | | |
2930 | 2930 | | |
2931 | 2931 | | |
2932 | | - | |
| 2932 | + | |
2933 | 2933 | | |
2934 | | - | |
| 2934 | + | |
2935 | 2935 | | |
2936 | 2936 | | |
2937 | 2937 | | |
| |||
3786 | 3786 | | |
3787 | 3787 | | |
3788 | 3788 | | |
3789 | | - | |
3790 | | - | |
3791 | | - | |
3792 | | - | |
3793 | | - | |
3794 | | - | |
3795 | | - | |
3796 | | - | |
3797 | | - | |
3798 | | - | |
3799 | | - | |
3800 | | - | |
3801 | | - | |
3802 | | - | |
3803 | | - | |
3804 | | - | |
3805 | | - | |
3806 | | - | |
3807 | | - | |
| 3789 | + | |
| 3790 | + | |
| 3791 | + | |
| 3792 | + | |
| 3793 | + | |
| 3794 | + | |
| 3795 | + | |
| 3796 | + | |
| 3797 | + | |
| 3798 | + | |
| 3799 | + | |
3808 | 3800 | | |
| 3801 | + | |
| 3802 | + | |
| 3803 | + | |
3809 | 3804 | | |
3810 | 3805 | | |
3811 | 3806 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
67 | | - | |
| 67 | + | |
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
126 | 126 | | |
127 | 127 | | |
128 | 128 | | |
| 129 | + | |
129 | 130 | | |
130 | 131 | | |
131 | 132 | | |
| |||
1325 | 1326 | | |
1326 | 1327 | | |
1327 | 1328 | | |
1328 | | - | |
1329 | | - | |
| 1329 | + | |
1330 | 1330 | | |
1331 | 1331 | | |
1332 | 1332 | | |
| 1333 | + | |
| 1334 | + | |
| 1335 | + | |
| 1336 | + | |
| 1337 | + | |
| 1338 | + | |
| 1339 | + | |
| 1340 | + | |
| 1341 | + | |
| 1342 | + | |
| 1343 | + | |
| 1344 | + | |
| 1345 | + | |
| 1346 | + | |
| 1347 | + | |
| 1348 | + | |
| 1349 | + | |
| 1350 | + | |
| 1351 | + | |
| 1352 | + | |
1333 | 1353 | | |
1334 | 1354 | | |
1335 | 1355 | | |
| |||
0 commit comments