I'm familiar with the Petrunin gluing theorem that states that gluing two Alexandrov spaces $M_1,M_2\in Alex(k)$ along their boundaries via an isometry $:\partial M_1\rightarrow \partial M_2$ results in an Alexandrov space of the same lower curvature bound.

I'm wondering for what "parts" of the boundary we may restrict such a gluing and still obtain an Alexandrov space. For example, two eighth-spheres of $S^2$ (geodesic triangles with three right angles) can be glued along a single edge, resulting in a quarter-sphere, and all three are $Alex(1)$.

I think in this example, the two eighth-spheres could be open and the gluing could be done along the interior of a boundary edge, but I'm interested in what other type of restrictions are possible. That is, under what conditions is it true that if $E_1\subset \partial M_1$ and $E_2\subset \partial M_2$ are isometric, gluing along this isometry produces an $Alex(k)$ space?

Of particular interest to me is if $E_1, E_2$ are themselves isometric $Alex(k)$ spaces with non-empty boundary. Does gluing along their interiors produce an $Alex(k)$ space?

This question is migrated from SE.