@@ -1261,18 +1261,19 @@ trim_msg_status(MsgStatus) ->
1261
1261
queue_index -> MsgStatus
1262
1262
end .
1263
1263
1264
- with_msg_store_state ({MSCStateP , MSCStateT }, true , Fun ) ->
1265
- {Result , MSCStateP1 } = Fun (MSCStateP ),
1266
- {Result , {MSCStateP1 , MSCStateT }};
1267
- with_msg_store_state ({MSCStateP , MSCStateT }, false , Fun ) ->
1268
- {Result , MSCStateT1 } = Fun (MSCStateT ),
1269
- {Result , {MSCStateP , MSCStateT1 }}.
1264
+ with_msg_store_state ({{ Mod , MSCStatePInternal } , MSCStateT }, true , Fun ) ->
1265
+ {Result , MSCStatePInternal1 } = Fun (Mod , MSCStatePInternal ),
1266
+ {Result , {{ Mod , MSCStatePInternal1 } , MSCStateT }};
1267
+ with_msg_store_state ({MSCStateP , { Mod , MSCStateTInternal } }, false , Fun ) ->
1268
+ {Result , MSCStateTInternal1 } = Fun (Mod , MSCStateTInternal ),
1269
+ {Result , {MSCStateP , { Mod , MSCStateTInternal1 } }}.
1270
1270
1271
1271
with_immutable_msg_store_state (MSCState , IsPersistent , Fun ) ->
1272
- {Res , MSCState } = with_msg_store_state (MSCState , IsPersistent ,
1273
- fun (MSCState1 ) ->
1274
- {Fun (MSCState1 ), MSCState1 }
1275
- end ),
1272
+ {Res , MSCState } = with_msg_store_state (
1273
+ MSCState , IsPersistent ,
1274
+ fun (Mod , MSCState1 ) ->
1275
+ {Fun (Mod , MSCState1 ), MSCState1 }
1276
+ end ),
1276
1277
Res .
1277
1278
1278
1279
msg_store_client_init (MsgStore , MsgOnDiskFun , Callback , VHost ) ->
@@ -1290,28 +1291,30 @@ msg_store_client_init(MsgStore, Ref, MsgOnDiskFun, Callback, VHost) ->
1290
1291
msg_store_write (MSCState , IsPersistent , MsgId , Msg ) ->
1291
1292
with_immutable_msg_store_state (
1292
1293
MSCState , IsPersistent ,
1293
- fun ({ Mod , MSCState1 } ) ->
1294
- Mod :write_flow (MsgId , Msg , MSCState1 )
1294
+ fun (Mod , MSCStateInternal ) ->
1295
+ Mod :write_flow (MsgId , Msg , MSCStateInternal )
1295
1296
end ).
1296
1297
1297
1298
msg_store_read (MSCState , IsPersistent , MsgId ) ->
1298
1299
with_msg_store_state (
1299
1300
MSCState , IsPersistent ,
1300
- fun ({ Mod , MSCState1 } ) ->
1301
- Mod :read (MsgId , MSCState1 )
1301
+ fun (Mod , MSCStateInternal ) ->
1302
+ Mod :read (MsgId , MSCStateInternal )
1302
1303
end ).
1303
1304
1304
1305
msg_store_remove (MSCState , IsPersistent , MsgIds ) ->
1305
1306
with_immutable_msg_store_state (
1306
1307
MSCState , IsPersistent ,
1307
- fun ({ Mod , MSCState1 } ) ->
1308
- Mod :remove (MsgIds , MSCState1 )
1308
+ fun (Mod , MSCStateInternal ) ->
1309
+ Mod :remove (MsgIds , MSCStateInternal )
1309
1310
end ).
1310
1311
1311
1312
msg_store_close_fds (MSCState , IsPersistent ) ->
1312
1313
with_msg_store_state (
1313
1314
MSCState , IsPersistent ,
1314
- fun ({Mod , MSCState1 }) -> Mod :close_all_indicated (MSCState1 ) end ).
1315
+ fun (Mod , MSCStateInternal ) ->
1316
+ Mod :close_all_indicated (MSCStateInternal )
1317
+ end ).
1315
1318
1316
1319
msg_store_close_fds_fun (IsPersistent ) ->
1317
1320
fun (? MODULE , State = # vqstate { msg_store_clients = MSCState }) ->
@@ -2938,6 +2941,7 @@ start_new_store_sup() ->
2938
2941
ok = rabbit_sup :start_child (? PERSISTENT_MSG_STORE_SUP ,
2939
2942
rabbit_msg_store_vhost_sup ,
2940
2943
[? PERSISTENT_MSG_STORE_SUP ,
2944
+ rabbit_msg_store ,
2941
2945
undefined , {fun (ok ) -> finished end , ok }]),
2942
2946
? PERSISTENT_MSG_STORE_SUP .
2943
2947
0 commit comments