Repository navigation
Commit 9ce18eb
committed
fix(engine) #5636: read the WAL stat map once, and keep the PR-time Meterian signal
Round 2 review on #5640. Four of the five points applied, one declined with the reason recorded in the code.
1. collectDatabaseStats() called TransactionManager.getStats() twice per open database - once inside the fold
for pagesWritten/bytesWritten and again for logFiles - and that call allocates a HashMap and walks the
active WAL pool each time. Since the whole point of the refactor was to stop maintaining two copies of the
loop, accumulateMonotonic now returns the map it read. logFiles cannot join the fold itself: it is a current
count, not a total, so carrying it across a close would inflate it forever.
3. unregisteringTwiceFoldsTheCountersOnlyOnce asserted exact equality against a JVM-singleton counter. Today
surefire runs forkCount=1/reuseForks=true so classes are sequential, but the assertion would go intermittent
the day that changes. Bounded instead: a second fold would add at least this database's own QUERIES again.
4. The two new Schema methods are source-incompatible for a third-party implementor. Noted in the release notes.
5. Meterian keeps running on pull_request. continue-on-error already stops it failing the check, so dropping the
PR trigger would have thrown away the per-PR SARIF diff for no gain: a newly introduced vulnerable dependency
now still surfaces at PR time rather than only once it lands on main.
Point 2 (the scrape path has no per-database try/catch while the close path does) is declined, and why is now a
comment on collectDatabaseStats: skipping a database whose stat sources are mid-teardown would drop its
contribution from one snapshot and restore it on the next, which is a transient DIP - precisely the counter-reset
artifact this change exists to eliminate. Letting the read throw surfaces as a failed scrape, which Prometheus
handles by carrying the last value forward. A wrong number is worse than a missing one here.1 parent d670891 commit 9ce18eb
4 files changed
Lines changed: 31 additions & 6 deletions
File tree
- .github/workflows
- docs
- engine/src
- main/java/com/arcadedb
- test/java/com/arcadedb
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
21 | 25 | | |
22 | 26 | | |
23 | 27 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
945 | 945 | | |
946 | 946 | | |
947 | 947 | | |
| 948 | + | |
| 949 | + | |
| 950 | + | |
| 951 | + | |
948 | 952 | | |
949 | 953 | | |
950 | 954 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
122 | 122 | | |
123 | 123 | | |
124 | 124 | | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
125 | 131 | | |
126 | 132 | | |
127 | 133 | | |
128 | 134 | | |
129 | 135 | | |
130 | 136 | | |
131 | | - | |
132 | | - | |
133 | | - | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
134 | 142 | | |
135 | 143 | | |
136 | 144 | | |
| |||
146 | 154 | | |
147 | 155 | | |
148 | 156 | | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
149 | 161 | | |
150 | | - | |
| 162 | + | |
151 | 163 | | |
152 | 164 | | |
153 | 165 | | |
154 | 166 | | |
155 | 167 | | |
156 | 168 | | |
157 | 169 | | |
| 170 | + | |
158 | 171 | | |
159 | 172 | | |
160 | 173 | | |
| |||
Lines changed: 6 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
23 | 24 | | |
24 | 25 | | |
25 | 26 | | |
| |||
113 | 114 | | |
114 | 115 | | |
115 | 116 | | |
116 | | - | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
117 | 121 | | |
118 | | - | |
| 122 | + | |
119 | 123 | | |
120 | 124 | | |
121 | 125 | | |
| |||
0 commit comments