Commit f39fffa
committed
[#962] Flag an admin action when a bounded storage write gives up on a configuration change
Storage.write() no longer retries until it succeeds: JDBCStorage.write() has long been bounded by
a number of attempts and a time window, and PDBStorage.write() is bounded too since #937. Once the
bound is spent, write() throws instead of replaying.
Four configuration change paths of the pluggable backends change in-memory state around such a
write, and none of them told the operator when the memory and the storage stopped agreeing: each
set the server error result code and handed back a bare single line stack trace, with no message
id to search the error log for and nothing said about what to do next.
- AttributeIndexCfgManager.applyConfigurationDelete takes the index out of attrIndexMap and
attrCryptoMap before the write, so a write which gives up leaves the trees in the storage while
the configuration entry naming them is already gone.
- VLVIndexCfgManager.applyConfigurationDelete does the same for a VLV index, whose data is held by
two trees, the index and the counter which goes with it.
- AttributeIndex.applyConfigurationChange applies the change with three writes: giving up on the
second leaves the trees of the removed indexes behind, and giving up on the third leaves the
entry limit the new configuration declares unapplied to the indexes which stay.
- EntryContainer.applyConfigurationChange hands the entries and every index of the backend the
parameters to encode with from now on, and giving up between the two leaves them encoded under
settings which no longer agree.
All four now report a message of their own - ERR_CONFIG_INDEX_DELETE_FAILED,
ERR_CONFIG_VLV_INDEX_DELETE_FAILED, ERR_CONFIG_INDEX_CHANGE_FAILED and
ERR_CONFIG_BACKEND_DATA_CHANGE_FAILED - which names what diverged and what has to be done about it,
keeps the stack trace as its trailing cause, sets adminActionRequired, and is logged as well as
returned: the divergence outlives the session which asked for the change.
The order of the two deletions is deliberately left alone: deleting inside the write would let a
replayed attempt find nothing to delete and commit an empty transaction, reporting success for
work it did not do.
AttributeIndex.applyConfigurationChange now publishes each part of the change after the write which
applied that part, rather than all of it between the first write and the second: the map of indexes
and the indexing options once the deletion has committed, still inside the entry container lock,
and the configuration once the update has committed.
EntryContainer.applyConfigurationChange no longer opens a transaction. Its body has performed no
transactional work since what it wrapped was removed - 7713117 added the wrapper around the
opening of the subordinate indexes and their entry limits, and 9f0904f (OPENDJ-1725) took that
work out of it, leaving id2entry.setDataConfig and the assignment of config behind - so what was
left was a transaction a bounded storage could give up on, in the middle of a sequence no rollback
can undo. The single step which
can fail, newDataConfig(cfg), now runs before the first mutation. The entry container lock stays:
publishing to the other threads was always its doing and never the transaction's.
ConfigChangeGivesUpTest covers the four paths through a backend whose storage gives up on a chosen
write, and pins what the messages claim, including the adoption of the trees left behind that
ERR_CONFIG_INDEX_DELETE_FAILED describes (#990).1 parent 1af0a12 commit f39fffa
5 files changed
Lines changed: 805 additions & 20 deletions
File tree
- opendj-server-legacy/src
- main/java/org/opends/server/backends
- pdb
- pluggable
- messages/org/opends/messages
- test/java/org/opends/server/backends/pluggable
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
712 | 712 | | |
713 | 713 | | |
714 | 714 | | |
715 | | - | |
716 | | - | |
| 715 | + | |
| 716 | + | |
717 | 717 | | |
718 | 718 | | |
719 | 719 | | |
| |||
Lines changed: 23 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
973 | 973 | | |
974 | 974 | | |
975 | 975 | | |
976 | | - | |
977 | | - | |
978 | | - | |
979 | | - | |
980 | 976 | | |
981 | 977 | | |
982 | 978 | | |
| |||
992 | 988 | | |
993 | 989 | | |
994 | 990 | | |
| 991 | + | |
| 992 | + | |
| 993 | + | |
| 994 | + | |
| 995 | + | |
| 996 | + | |
| 997 | + | |
| 998 | + | |
| 999 | + | |
| 1000 | + | |
| 1001 | + | |
995 | 1002 | | |
996 | 1003 | | |
997 | 1004 | | |
| |||
1020 | 1027 | | |
1021 | 1028 | | |
1022 | 1029 | | |
| 1030 | + | |
| 1031 | + | |
| 1032 | + | |
| 1033 | + | |
1023 | 1034 | | |
1024 | 1035 | | |
1025 | 1036 | | |
| 1037 | + | |
| 1038 | + | |
| 1039 | + | |
| 1040 | + | |
| 1041 | + | |
| 1042 | + | |
1026 | 1043 | | |
1027 | | - | |
| 1044 | + | |
| 1045 | + | |
1028 | 1046 | | |
1029 | 1047 | | |
1030 | 1048 | | |
| |||
Lines changed: 33 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
268 | 268 | | |
269 | 269 | | |
270 | 270 | | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
271 | 278 | | |
272 | | - | |
| 279 | + | |
| 280 | + | |
273 | 281 | | |
274 | 282 | | |
275 | 283 | | |
| |||
369 | 377 | | |
370 | 378 | | |
371 | 379 | | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
372 | 384 | | |
373 | | - | |
| 385 | + | |
| 386 | + | |
374 | 387 | | |
375 | 388 | | |
376 | 389 | | |
| |||
2557 | 2570 | | |
2558 | 2571 | | |
2559 | 2572 | | |
2560 | | - | |
2561 | | - | |
2562 | | - | |
2563 | | - | |
2564 | | - | |
2565 | | - | |
2566 | | - | |
2567 | | - | |
2568 | | - | |
| 2573 | + | |
| 2574 | + | |
| 2575 | + | |
| 2576 | + | |
| 2577 | + | |
| 2578 | + | |
| 2579 | + | |
| 2580 | + | |
| 2581 | + | |
| 2582 | + | |
| 2583 | + | |
2569 | 2584 | | |
2570 | 2585 | | |
2571 | | - | |
| 2586 | + | |
2572 | 2587 | | |
| 2588 | + | |
2573 | 2589 | | |
2574 | 2590 | | |
2575 | 2591 | | |
| 2592 | + | |
| 2593 | + | |
| 2594 | + | |
2576 | 2595 | | |
2577 | | - | |
| 2596 | + | |
| 2597 | + | |
2578 | 2598 | | |
2579 | 2599 | | |
2580 | 2600 | | |
| |||
Lines changed: 24 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1132 | 1132 | | |
1133 | 1133 | | |
1134 | 1134 | | |
| 1135 | + | |
| 1136 | + | |
| 1137 | + | |
| 1138 | + | |
| 1139 | + | |
| 1140 | + | |
| 1141 | + | |
| 1142 | + | |
| 1143 | + | |
| 1144 | + | |
| 1145 | + | |
| 1146 | + | |
| 1147 | + | |
| 1148 | + | |
| 1149 | + | |
| 1150 | + | |
| 1151 | + | |
| 1152 | + | |
| 1153 | + | |
| 1154 | + | |
| 1155 | + | |
| 1156 | + | |
| 1157 | + | |
| 1158 | + | |
0 commit comments