Skip to content

New file replica state is depending on the source node #1110

@yiiyama

Description

@yiiyama

&dbexec($dbh, qq{
merge into t_xfer_replica xr using
(select xt.to_node, xt.fileid, xtd.time_update, fn.kind
from t_xfer_task_harvest xth
join t_xfer_task xt on xt.id = xth.task
join t_xfer_task_done xtd on xtd.task = xth.task
join t_adm_node fn on fn.id = xt.from_node
where xtd.report_code = 0) new
on (xr.node = new.to_node and xr.fileid = new.fileid)
when not matched then
insert (id, node, fileid, state, time_create, time_state)
values (seq_xfer_replica.nextval, new.to_node, new.fileid,
case when new.kind = 'MSS' then 0 else 1 end,
new.time_update, new.time_update)});

New entries to t_xfer_replica are created by FilePump. The state field is set to 0 or 1 depending on the kind of the source node. I think new.kind was supposed to be the kind of the destination node (which would make more sense from the name new too..).

If this is the case, I think we also need to go in to TMDB and set the state of all file replicas on Disk and Buffer nodes to 1. About half of replicas on Disk and almost all of them on Buffer are state 0 at the moment.

Just to make sure, I grepped the entire repository for parts that are dealing with t_xfer_replica.state. The only component that would ever set state to 0 is Stager, which I believe should be handling only MSS nodes.

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions