Files
openobserve/src
Yashodhan JoshiandYashodhan Joshi 14a41bf63c fix: handling of cache cleaning for user delete (#9656)
### **User description**
This fixes the issue of how we handle the in-mem cache cleanup for user
deletion, specifically in case where use only has a single org
attributed to them.
This also adds few more error logs so if something goes wrong, we know
that it went wrong instead of silently ignoring that.

Cherry pick of https://github.com/openobserve/openobserve/pull/9655 for
main branch


___

### **PR Type**
Bug fix, Enhancement


___

### **Description**
- Propagate errors and log failures for NATS notifications

- Fix cache watch removal logic for multi-org users

- Add error handling in HTTP user-remove handler


___



<details> <summary><h3> File Walkthrough</h3></summary>

<table><thead><tr><th></th><th align="left">Relevant
files</th></tr></thead><tbody><tr><td><strong>Error
handling</strong></td><td><table>
<tr>
  <td>
    <details>
<summary><strong>org_users.rs</strong><dd><code>Add error logging and
fix cache watch removal</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></summary>
<hr>

src/service/db/org_users.rs

<ul><li>Replace ignored NATS delete calls with <code>inspect_err</code>
logging<br> <li> Propagate errors from
<code>delete_from_db_coordinator</code><br> <li> Revise
<code>watch</code> to remove multi-org user records from cache</ul>


</details>


  </td>
<td><a
href="https://github.com/openobserve/openobserve/pull/9656/files#diff-3cbb516ea021b4c03cf4b5f9de2ebcd4a8afee0722a4bcc5c39cb78f485900b6">+24/-14</a>&nbsp;
</td>

</tr>

<tr>
  <td>
    <details>
<summary><strong>user.rs</strong><dd><code>Log and propagate user delete
notifications</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></summary>
<hr>

src/service/db/user.rs

<ul><li>Turn ignored delete notification into logged error via
<code>inspect_err</code><br> <li> Propagate errors from
<code>delete_from_db_coordinator</code><br> <li> Maintain super-cluster
delete under enterprise flag</ul>


</details>


  </td>
<td><a
href="https://github.com/openobserve/openobserve/pull/9656/files#diff-6ee6b0fc9ed03224d4ddf0b7b631c6f81ff7d1d579bdb98d2c5d4453852eb5d6">+3/-1</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>

<tr>
  <td>
    <details>
<summary><strong>users.rs</strong><dd><code>Enhance HTTP handler error
handling for removals</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; </dd></summary>
<hr>

src/service/users.rs

<ul><li>Replace <code>match</code> with <code>if let Err</code> for
invite deletion logging<br> <li> Add error-check and early return for
<code>db::user::delete</code><br> <li> Handle
<code>org_users::remove</code> errors with logging and HTTP error
response</ul>


</details>


  </td>
<td><a
href="https://github.com/openobserve/openobserve/pull/9656/files#diff-98da2588a28d62bb2e301d989836125f89f89b76272cd7f75e08ec4deeea5f38">+49/-33</a>&nbsp;
</td>

</tr>
</table></td></tr></tr></tbody></table>

</details>

___

---------

Signed-off-by: Yashodhan Joshi <yjdoc2@gmail.com>
Co-authored-by: Yashodhan Joshi <yjdoc2@gmail.com>
2025-12-17 11:24:25 +05:30
..
2025-09-16 19:02:47 +08:00
2025-09-16 19:02:47 +08:00
2025-12-04 13:58:09 +05:30