While the England football team have taken a brave stance against racism by taking a knee at the start of matches, Britain's political leaders had remained fairly silent. On Monday Boris Johnson's spokesperson refused to condemn fans that booed players as they protested against racism. And Keir Starmer has said, as usual, nothing. That has now all changed. So six days after the initial incident, the Prime Minister's spokesperson said that Boris Johnson wants fans to cheer England's players on, not boo them. Now, a couple of hours after that story broke, the Guardian published an exclusive interview with Keir Starmer, in which he accused the Prime Minister of failing to show leadership. Now, Starmer told the paper, the idea you boo the team is completely wrong. This is the response to what is an important collective decision by the team about their expression of their opposition to discrimination and racism. That's a decision they've taken. And I think they're right. All of us should support them and all of us in a position to do so should show leadership as Gareth Southgate has done and have the courage to call it out and say it's the wrong thing to do. The Prime Minister was wrong when he refused to call it out. He didn't have the guts to call it out. He hedged his bets and in doing so, he undermined the team on the verge of this competition. He didn't have the courage to side with the players. That is leadership. Compare and contrast him and Gareth Southgate on this. He didn't have the courage to stand by the England team on the verge of this competition. And he's wrong about that. And that's a failure of leadership. Now, that's all very well. I agree with everything Keir Starmer has said there. The problem is it took him six days to say it. So if you're saying Boris Johnson didn't show leadership because he didn't condemn the people booing the England players, he even did Keir Starmer, right, until six days later. Now, why did it take this long? It could have been that they were waiting for a focus group to deliver back their results. Or it could have been that like the rest of us, Keir Starmer's team were on Twitter on Thursday and saw that YouGov had actually done a poll on this and that their silence was very much out of step with the general public. So YouGov did a poll among fans across all of Europe, because obviously countries all across Europe who were entering Euro 2020, and they found overwhelming support for people taking the knee basically everywhere, most strongly in Portugal, which I found somewhat surprising. But also very strong in England. So in England, 54% of people support players taking the knee. Only 39% of people oppose it. That rockets to 78% of people when only asking ethnic minority Britons. Only 12% of ethnic minority Britons oppose taking the knee. Aaron Starmer has finally come to the right position, but he sure has taken his time. Does he demonstrate the failure of leadership that he accuses Boris Johnson of? 100%. I mean, what he's saying about Gareth Southgate is embodying a certain kind of leadership I entirely endorse. I think it's absolutely true. I think what Gareth Southgate has done is show real moral courage, which is incredible.  So I stand with the LGBT community or Black Lives Matter, and then they become really unpopular. And then they go, oh, God, yeah, you're right. Solidarity with the Palestinian people under occupation. And they become unpopular. People criticize them. They might start losing jobs. They might start having, have people who they respect say, that's wrong. Actually, I don't agree with you on that. And they don't have moral courage. And so they say, oh, you know what, you're right. It's complicated. They might even take back what they initially said. And what Gareth Southgate has doubled down, not a belligerent way. And he said, no, actually, I've thought about this as a team we've collectively decided this. This is what we're going to do. And that's leadership. And so Stammer's right to observe leadership and highlight the facts. But like you say, Michael, this is another classic example of Keir Starmer, ambulance chasing a political cause. You know, people call him Captain Heinz, I think for good reason. And I think this is an example of that. And it has that double problem for him. Because like you say, the leadership qualities, the moral courage, and I would not use those two words with Keir Starmer, by the way, moral courage, put them out of the window. They really highlight his own deficiencies. Because those are the exact things he doesn't embody. You know, you might not agree with Brexit. I don't think Boris Johnson agree with that at one point. But the whole point of that political project that took the tourists to a major majority a couple of years ago was, there's this thing, we're going to do it. We think it's the right thing, because that's what people voted for. You know, and that's a politics, again, that Labour and Keir Starmer put themselves in opposition to. Or any number of causes over the 18 months since he's been the leader more than a year, you would never associate him with moral courage. So, yeah, I think this is doubly bad for him. I think at this point, Michael, I mean, it's a bit of a tangent, but I think just Keir's kind of a bit of a joke, right? You know, I was watching Arsenal Fan TV on YouTube and they're like taking the piss out of Keir Starmer. Now, that's really cut through. The guy's a bit of a joke. What I think people dislike about Keir Starmer is actually strange enough what he was pitching. It's just that his pitch has really not gone down very well. You know, I don't really believe in very much.  You just wear a suit. You don't really believe in anything. And it's kind of like, for me, that's what's really interesting with Starmer is that people dislike him not because they've not seen enough of him, not because they don't interpret him properly or because he's been misrepresented in media, they identify precisely what he's trying to sell. And that's what they don't like. What really struck out this week was that you've shown that Keir Starmer now has ratings, which are, you know, just as bad as Jeremy Corbyn was at this same stage in his leadership. And I can say, Oh, why are you critiquing someone for being just as unpopular as the guy you supported? Well, Jeremy Corbyn was subject to a really big smear campaign. Keir Starmer hasn't been. And what's interesting, you know, you might say, Oh, well, we're being biased because we're saying maybe he has been subject to a smear campaign and we're not recognizing it. Even Keir Starmer's stands don't say the media have misrepresented him.  He's clearly been correctly represented. The media have reported Keir Starmer as he is. I mean, it's because they don't find him threatening. Why would they bother to smear him? But they have reported him as he is. The public don't like him. And he's panicking now because what can you do if they're seeing the real you and they don't like it? That's exactly it. I mean, it's unique, Mike. We're looking here at a story in British public life, which the media are accurately representing. It doesn't happen very often. It's happened with Keir Starmer.  We were open minded about Keir Starmer. And I think the pitch that he had when he became leader, I'll be 80% of Corbyn's policies, but I'll be wearing a suit and lead into my credentials as a former director of public prosecutions. Actually, if you really mean that, I think that's a really great thing to aspire to as Labour leader. Obviously, he didn't. But I never thought he would be this not even bad. I never thought the numbers would fall apart this quickly. You know, you look for instance, I didn't, I definitely didn't 18 to 24s. You've got I think Labour on 35, the down like 20 something. You've got like the green second on like 24. I mean, we've got this on Twitter today. And the choice on 21. And people say, all right, you just very four year olds don't vote. I mean, this is your base. Minorities, renters, graduates, the young, public sector workers. We saw a poll recently, actually, an astonishing number of nurses back Boris Johnson, not particularly fond of Keir Starmer. You know, Labour are really looking at a real hiding at the next general election. Like it's frightening. And I think we're going to get a glimpse of a battle in spend. And what's different with battle in spend, and I will bring this back to the Southgate thing. What's different with battle in spend to say Harley pool is, Harley pool is super explicable in terms of long term trends. Battle in spend is really different. You know, yes, it was a marginal. Yes, you know, has elements of people that wants to leave the European Union and so on. It was a big file right there. Not long ago. I mean, obviously, the terrible events around Joe Cox demonstrate that. I think the BMP of the National Front, you know, back in the day, big locally. But what they what they really show I think in battle in spend is the potential of Labour's vote, the potential of Labour's vote to vulcanize. And in battle in spend, you're seeing that with Labour and George Galloway, right, potentially. So some Labour voters may be going over to the Tories. Some may be going to other parties for whatever reason, and then you've got George Galloway. And that's going to happen, I think, in lots of places. You know, Labour's problem now is losing voters both to your left and to your right, which is something that Jeremy Corbyn 2017 almost miraculously actually over, you know, he overcame. So it was the exact same challenge that was confronting a milliband in 2015. So going back to the Gareth Southgate thing, you know, it just reeks of desperation like so many of these things. Just don't say anything here. You weren't on the story. Look, we're content creators of our media, Michael. You know, you don't talk about a story from three weeks ago on Tisgy Sour, do you? People aren't interested anymore. If you want to show political leadership, if you want to influence the debate here, you should do it when you should have done it, which wasn't, you know, on Friday. It was on Monday or it was last week. And it was a real open goal as well, by the way.  Not hard.


Food intake is determined by learned appetitive responses and physiological appetite signals after eating begins. Here, authors show melanin-concentrating hormone, MCH. Producing neurons integrate these processes to promote caloric intake. This article was authored by Keshav S. Subramanian, Logan Tierno-Lauer, Anna M. R. Haith, and others.


I would like to live if you would so please. Oh, no, no, no don't call your pops. Don't call your pops. Leave him at home We living We're flying I Thought he would rush in How's going everybody? Dato doi here with another dragon ball fighters video and well, well, well We got Albert on the line. I actually played a couple of warm-up matches before this video with this team Let's just say my my rival Albert here He took me he took me to school. He took me to school. I'll admit I Did forget to thank the bus driver though So if you see me do stuff that I normally don't do it's because Albert has conditioned me not to do them He's gonna wake up sure you can know delayed get up. He did that a lot too.  Okay, so wow I Did not put up this good of a fight before by the way his gohan wrecked me the entire time But man now that we're warmed up this team's looking pretty good I'm playing this because you know we played a lot of Super Saiyan Goku and Yamcha over the uh, oh It worked. I called in a oh Wow didn't time that properly I'm playing this team because we played so much Super Saiyan Goku and Yamcha and I got a comment I was like, hey, you know, I could I would like to see some other teams. I Was like you're right You're right. So I just put this slap this little team together Going down back to the corner. Oh god. That's punishable by death. He just snagged me out of the air That ain't working. Oh, I didn't expect a key blast, but that was a good option All right, we're back in the corner. I'm gonna down tech. I Should have sure you can I should have hit him with the DP now We're gonna lose our best assist here and Broly switched out So this does present us with an opportunity. Maybe if we can get Broly back in our chances of winning would go a lot higher That's for sure. All right, let's see what you got. There we go. All right Forget combo and Goku who needs that right now. I want to see this boy Broly Yep, I hit him a lot with that before so I guess you know, he saw it coming Switching media tag. Oh No, my back dashing ways Gets me once again. All right. We're in the corner again All right, we needed that we needed that for sure. I can't get reflected that Just steps on me. All right, you're done for no Yes, I held it so I could hit that after the deflect. Oh god. That was lucky whoo no skill involved The rivals are back at it again. Oh, don't even think about it Okay, okay, think about that. Oh Drats dude, I did not land far enough. I got a stall out this Sparking to and I think 17 is long dead. Oh he back dashes and a bit of lag Random level three. I couldn't get there in time. Oh. Oh, I tried back I tried wall dashing to the back. It didn't really turn out for me though. Oh Do we hit him did that hit? It did. All right. We got big damage We got big damage and the sparking's out. Come on. Come on hit hit hit hit. Oh, no Oh, he instantly went in. Okay. He instantly went in that's still them. That's still some damage No way it clipped me. Is this the power of anime is this anime? I Didn't know this was anime. I Didn't know I was watching this show.  Oh Down tech buttons. He hit me with that last match. It's so fast But you don't get switched out Android 17 is begging you Yeah, I did that a lot last much too. Oh, no No, that's it. Oh, come on. I was tacky. Oh, I guess I was attacking and that's why I like to tech with the grab button Because you know sometimes when you get the proper delay, I'm you're just gonna be mad Okay, that understandable. Have a nice day Understand that's not gonna hit. I don't think so. Anyway, that'd be have to be mad fast. Oh Like that. Ah, you can't back dash those big meaty claws. You can't do it. So we're taking the trip to the All right. All right There we go. I don't know why we didn't get the tech Didn't get it again. Oh god. Oh god said frames.  I Got opened up, but okay Open I'm gonna spend two bars because really I don't want Vegeta out front I would like Broly out front so that he could use Vegeta assist So that's my logic there even though, you know, that is technically wasting a bar. I Try to to meet him halfway Try to meet him in the middle with Super Dash probably should have just stayed on the ground Afraid of the DP there. I didn't take in time. Oh I didn't I didn't even react to it. I felt no fear because I didn't see it coming. All right, that's time. No problem. Oh Super Dash after grab only the most fearless warriors Only the no fear in their hearts warriors can do that Unfortunate, but I understand Unfortunate again, but I understand I Would like to live if you would so please. Oh, no, no, no, no. Don't call your pops. Don't call your pops. Leave them at home We living We're flying.  No Unfortunate that I didn't do the heavy two pairs of legs activating magnetic friction Go into my Android. Have you got them off? Unforged down tech buttons work so good and I have my auto count Android 17's auto combo is trash I was like try to lock down for No quick tag Broly. No quick tag. Okay. Okay. Okay. Okay. Let's focus on the good Let's just focus on the good now. You may be asking what what is the good?  Ah God Broly's light didn't connect there. Oh, yeah. We have we have ah Pick them up. That's fine Uh-huh. I missed time. Oh, that was all me. Oh God. Throw me down Albert.   Oh, okay, didn't oh, oh, that's fine Okay, okay. Yeah, key blast.  I wouldn't listen. No And the dragon rush again. I thought he wouldn't try it. I've been vanishing so frequently Did that hit?  Okay, come on buckle down and at least give it a good show How do you go over Broly the dude is seven feet tall? Yeah There we go. There we go Vegeta. Come on. Show me that pride Show me that pride you want to lose 3-0 and you know what? We don't even want to lose 2-0 and I'm gonna say no, I don't even want to lose Down-tech buttons is so scary in this world that we live in I Tried vanishing. Oh, no, he's gonna try to burst me. He's gonna try to burst me. Oh my god. It's bursting. Oh But not enough.  He always goes three games. So, you know that last time he did that, too Oh The next time we play Albert, I swear to God, I swear to God Albert. I'm coming for you Huh Albert Albert gets better every time I play. I think I'm you know, wait wait a minute He beat me with an anime finish. He gets better every time we play Hey Albert's a saying Albert's an actual saying Well, I'm gonna go call it after that. I gotta go ahead and call it man Yeah, go ahead and let me know down in the comments if you do have a favorite moment As always while you're down there if you like this video and channel and want to see more of these videos Make sure to the like button and subscribe and hey if you're new here and maybe click on a few of these other videos on the screen You know, we got some other Dragon Ball content and some other fighting game content So maybe some of that will fit your fancy other than that guys I'm gonna go ahead and get out of here as always. I'm Dr. Doya and I'll see you in the next video


What's going on guys? It's your boy dpj here today with another episode of another episode of the meta where today I'll be using the hilt of my sword. I know this ain't going to go down too good, you know why? Because I'm going to be playing Iron Bandit as well where everybody's been sweating. Everyone's been sweating. Well let's get straight into it.    But yes, if you want to see more as well drop a like or do a pow, wish you ate that support. But let's go! I have a one of two ways, me rage creating and breaking my controller or me rage creating and breaking my Xbox. I'm aiming for one kill, one kill at the hard ground corners. Go dickforser, he's going to turn on me.


Hello, today we will look at how to estimate the lift coefficient of a military aircraft. And as an example, we have taken F16C fighting Falcon to illustrate the procedure. Before you actually go ahead and watch this tutorial, I would advise you to have a look at the procedure for lift coefficient estimation that we have already discussed. Because tutorials are meant for students who have already seen the lecture, they know the procedure and here we only show you how that procedure is implemented for a practical aircraft. So, if you have not watched the lecture on lift coefficient estimation for military aircraft, I would recommend that you first watch those lecture clips and then only do this tutorial. We are going to follow a color scheme in this presentation. The general instructions are going to be given in brown color, which is the basic theme of this presentation. If there are some values which are specified either online or in the specifications of the aircraft, they will be shown in black color. There are certain values which we will assume based on literature or any other source book, those will be shown in this blue color. The places where you have to do some calculations will you will be alerted with red color question marks and when you see this pause button, I would recommend that you actually pause the video at that stage and do the calculations and then only proceed further. I would like to reiterate that aircraft design is learnt best by doing the calculations. Just by listening to a video and nodding your head, you will not be able to really appreciate the calculations and hence you will not get a feel for aircraft design. The values which are calculated will be shown in this dark blue color and towards the end, we will compare the values that we have obtained with some values mentioned in documents or open sources. So, those will be shown in the green color. Let us look at the source of the data and comparison for F-16C analysis. Our principal source for this particular tutorial is this excellent textbook by Brandt, Stiles, Burton and Wittford. It is a strongly recommended to go through this particular textbook. It is a very wonderful textbook which gives a general introduction to aeronautics but with a design perspective. So, we have looked at the third edition of this book and there is an example of a whole aircraft drag estimation and lift estimation. So, for this particular tutorial, we are following the lift estimation procedure explained by the authors in this particular textbook. This is the top view of the F-16C aircraft and this information is presented in the textbook in the form of geometrical data. So, we see that the leading edge sweep of the wing and the tail is 40 degrees but the quarter cot sweep is 30 degrees. This aircraft has a wingspan of 30 feet and the other numbers are already all mentioned there. So, in the textbook what they have done is the geometry has been presented in this way in the textbook. The data is given in the FPS system and we are going to use SI system in our tutorial. So, let us have a look at some of the useful parameters which we will utilize in this particular tutorial. First is the wingspan which is given as 30 feet or 9.144 meters. The wing reference area which is the plan form area in the top view including the area inside the fuselage as you can see in the figure is 300 square feet which is 27.87 square meters. The tail span or the distance between the tips of the two tail, two horizontal tails is 18 feet, 5.49 meters. The tail reference area or the area of the two trapezius that represent the tail is 108 square feet or 10.033 meter square. This aircraft is fitted with leading edge strakes near the wing root wing fuselage junction and these strakes are a total of 10 square feet each so that is 20 square feet area, 1.858 square meters. The root chord of the wing on the fuselage centerline is 16.5 feet which is 5.03 meters. The tip chord is 3.5 feet or 1.07 meters and the hinge line of the flaps are swept at an angle of 10 degrees. And also the maximum thickness line, the line along which we have the maximum thickness of the aerofoil approximately 40 percent of the chord the angle of that line is 24 degrees. So these are some of the parameters that we will need in our calculation. So it will be a good idea for you to either take a picture of this slide and keep it with you when you do the calculations or you can even note down these values on in a small document. Similarly, there are some information that we need regarding the side view of the aircraft. For example, the distance from the quarter chord of the wing and to the tail, the so called tail arm this is 14.7 feet or 4.48 meters and the location of the horizontal tail below the plane of the wing or above the plane of the wing as in this case is 1 feet or 0.3048 meters. So this is the another geometrical information that we will need. The first thing we will do is we will estimate Oswald efficiency factor E0. For that we will use some data for example, the sweep of the maximum thickness line. First let us calculate the wing aspect ratio. As you know aspect ratio is defined as span square by area. So we know the span 9.144, we know the area 27.87. So therefore aspect ratio is span square by area. This is the first place where you have to stop the video and do these calculations. It is very straightforward 9.144 square divided by 27.87. This number comes out to be 3. Similarly for the horizontal tail, we need to calculate the aspect ratio. For that we know that the tail span is 5.49 meters and tail area is 10.303 square meters. Once again aspect ratio is 5.49 square divided by 10.03. The second place to pause do the calculations. Turns out that the tail aspect ratio also is 3. So in this aircraft the tail is nothing but a scaled down version of the wing with similar geometry and similar aspect ratio, same aspect ratio. Now here is a formula from the book by Brandt et al for calculating the Oswald efficiency factor. There is a much more elaborate formula which we have used for transport aircraft. But for a military aircraft since we are following a standard reference, we would like to calculate the value of E0 also using that same formula. So as per this formula you need to know the aspect ratio of the wing or the tail and the sweep of the maximum thickness line. These numbers are known to us. So therefore when we insert these numbers in the formula, you now have to pause the video and calculate the value of E0. So do it first for the wing. The value turns out to be 0.703 and that is also applicable for the tail because the tail in this case has the same aspect ratio and the same sweep of the maximum thickness line. So both wing and tail have the same Oswald efficiency factor of 0.703. Let us estimate the lift curve slope now. We are told that this aircraft is fitted with NACA 64A204 airfoil in the wing as well as in the tail. The two-dimensional lift curve slope of the airfoil which is small cl alpha or also dcl by d alpha that is the definition. Here is a figure from one of the NASA NASA reports, NASA archive that talks about the aerodynamic data of the flood plate and the 64A204 airfoil. So from this figure we see that at angle of attack of 0 we have cl1 equal to 0 and at the angle of attack of 9 degrees we have cl1 equal to 1. So with these two points if we fit, if we want to get the linear lift curve slope we just fit a straight line between these two points and for that we can use a simple formula cl alpha will be dcl by d alpha that will be equal to cl2 minus cl1 and divide by alpha2 minus alpha1. So it turns out that cl2 is 1.0, cl1 is 0, alpha2 is 9.0, alpha1 is 0. So it is a simple calculation 1 divide by 9 but it is a good idea to pause and do the calculation yourself. The number is 0.11. So the lift curve slope of the airfoil is 0.11 per degree. Let us now use this information to calculate the lift curve slope of the entire wing, the so called 3D effects. So the 2D lift curve slope we have just calculated was 0.11 per degree. The 3D lift curve slope will be called as capital C, capital L alpha and here is a graph that shows how the cl alpha of the airfoil and wing are different. We notice that the wing has in general a lower lift curve slope compared to the airfoil and another thing we observe is that the angle at which the airfoil attains the maximum cl which was 9 degrees in our case is lower than the angle at which the wing will obtain its highest value. So the highest angle at which the wing will obtain the maximum cl is not 9 degrees but probably around 15, 16 degrees but there is a usable value and that number for this aircraft can be assumed to be 14 degrees. So remember we will use this number when we go ahead. So therefore the formula to be used as given in the book by Brent et al for the wing lift curve slope is equal to the airfoil lift curve slope divided by a quantity that takes care of the Oswald efficiency factor and the wing aspect ratio. So putting in the numbers for our case cl alpha for the airfoil is 0.11 the aspect ratio is 3 and the Oswald efficiency factor is 0.703. So therefore we can get the value of cl alpha for the wing. Please pause the video and do these calculation. The value comes out to be 0.056 for cl alpha for the wing and in this case it will be the same for the tail also because the tail aspect ratio is the same as the wing aspect ratio. So therefore they will have it will have the same geometry and hence it has a similar same value of the lift curve slope. Let us continue ahead. We will like to look at what is the effect of strikes on the lift curve slope because as I mentioned this aircraft is fitted with two strikes which are mounted at the wing fuselage junction ahead of the wing. These two strikes total area is 1.858 square meters it was 20 square feet and the wing reference area was 300. So it is to 27.87 square meters. So the book by Brandt et al gives a simple formula for calculating cl alpha of an aircraft with strike. If you know the value of cl alpha without the strike is nothing but scaling up the area of the wing in terms of the additional area of the strike. So it will become 300 plus 20 upon 300 in FPS system multiplied by the lift curve slope. In our case we know that the lift curve slope of the wing was 0.056 and we just have to multiply it by the ratio of ring reference area plus strike area divided by the ring reference area or we just scale up the value. So we find that the cl alpha with the strike becomes 0.06 per degree higher than 0.056 because of the presence of 20 square meter, 20 square feet of those two strikes. Let us look at the effect of the tail on the lift curve slope. So for that we use the data that the lift curve slope with strikes we have just calculated is 0.06 and these two distances L H of 4.48 the distance between the two quarter cords wing and the tail and the distance of the horizontal pole below or above the wing. So this information will be useful for us to calculate. Of course we also need wing tip cord, wing root cord, wing span. So first we calculate the wing taper ratio which is nothing but the tip cord by the root cord or 1.07 divided by 5.03. It is a good time to pause the video and calculate this number. The answer is 0.21. For the average cord we just take the average of these two numbers. Again you can pause here. The value is 3.05. So the parameter dou epsilon by dou alpha which is the rate of change of the downwash angle with the change in the angle of attack. It can be estimated using this formula given in the book by Brandt et al. So what we do is we just insert the values of the parameters that we know. For example CL alpha with strikes is 0.06. See average is just calculated L H is also known to us 10 minus 3 lambda by 7 and 1 minus Z H by B. So once you do all these calculations you can get dou epsilon by dou alpha. Please pause the video at this stage, calculate this value turns out to be 0.5. Moving ahead, so we know the lift curve slope with strikes as 0.06. We have just calculated the lift curve slope of the tail also as 0.056. The tail reference area was 10.03 meter cubes and we also know the wing reference area and we have just calculated dou epsilon by dou alpha as 0.5. So therefore CL alpha for the aircraft will be CL alpha with the strike which we have already calculated plus the tail CL alpha which is in this case same as the wing CL alpha into 1 minus dou epsilon by dou alpha into ST by S because this is a in a way a measure of the tail efficiency. How much of the tail is actually efficient? So putting in the numbers we get this expression 0.06 remember was the value of lift curve slope with strikes and 0.0563 was the slope of the tail lift curve of the tail. So pause at this stage and calculate this value we see that the CL alpha of the aircraft is 0.070. So in other words contributions to CL alpha have been taken from the tail from the strikes and from the wing. The net value is 0.070 per degrees. Now we are ready to do the estimation of the CL max of this aircraft during takeoff and landing. Takeoff is shown in the figure on the left and landing is shown in the figure in the right. If you notice carefully the angle of the aircraft both during takeoff and during landing seems to be very similar. So this is the actually the maximum usable angle of the aircraft. Now this angle is a function of at what what is the maximum angle you can deflect the aircraft along the main wheels during takeoff or landing without hitting the tail on the ground. This number is approximately 15 degrees but we keep a 1 degree margin so it will be 14 degrees and that will be called as the absolute maximum value of the absolute angle of attack of the aircraft 14 degrees and it will be the same in case of both takeoff and landing in this case. Estimation of maximum lift coefficient can now be attempted. CL max will be basically the CL alpha of the aircraft into the change in the absolute angle of attack which is attained during the flight. Now the change in the absolute angle of attack delta alpha is a function of what change is available if you use only the airfoil or the two-dimensional value then you multiply it by the flap area to the wing area or the flabbed area ratio and then cos of the sweep of the hinge line. So we notice that if you do not use full span flaps only a part of the wing is affected with the flaps and hence that part is the one that gets an improvement in the effective absolute angle of attack increase and if you have a hinge line which is swept then that causes reduction in its efficiency so that effect is brought in using the term cos of lambda HL. SF by S is the flap area ratio which is the ratio of the area covered by the flaps upon the total wing reference area and lambda HL as you know is the flap hinge line sweep angle. So first let us have a look at the flap areas and the unflapped areas. So all the area of the aircraft which is under the influence of the flaps whether leading edge flaps or trailing edge flaps that area the total area that is under the influence of both of them is called as the flapped area and as far as F16 is concerned you know this would be the total flapped area because the trailing edge flaps start from almost at the junction of the wing and the fuselage you can see almost and they go up to this place with the sweep of 10 degrees for the hinge line and there are leading edge flaps which start almost near the wingtips and go right up to here. So actually if you take the area which is influenced under both of these flaps you will get these two trapezia and that is going to be the flapped area. So let us calculate the flapped area ratio for F16C this is the area that we have to this is the area which is under the influence of the trailing edge devices and this is the area which is under the influence of the leading edge devices. So the net area is the one that is hashed and looking at the geometry of the aircraft we have determined that the dimensions of the flapped area are that of a trapezium of the larger side 4.1 the parallel side 1.07 and the distance between the two sides as 3.5 meters. So the area of the flaps will be the twice the area of each of these trapezium each of these trapezia. So the area of one trapezium would be half of the sum of the two parallel sides into the distance between them. So please pause the video and calculate the value of each trapezium area that is going to be 9.05 square meters. So each of these areas is 9.05 square meters the total flapped area is actually going to be double of this so 2 into 9.05 please calculate the value the answer is 18.1 square meters. So the flapped area is 18.1 square meters and remember that the total area is 27.87 square meters. So with this we can get the ratio of S flap by S or the flapped area ratio again I would suggest you pause the video and calculate this number the number turns out to be 0.65. Hence for this aircraft the flapped area ratio is 0.65 only 65 percent of the whole wing is actually under the influence of the flaps 35 percent of the flaps is not under the influence of the flaps and that area is mostly the area inside the fuselage actually over the fuselage. So the flapped area ratio is known as 0.65 hinge line of the flaps is swept at an angle of 10 degrees from literature given in the textbook or you can say back calculated from some number in the textbook we have determined that the angle of attack 2D at takeoff is 7.5 degrees and as I mentioned to you the maximum usable angle of attack at takeoff is 14 degrees. So an aircraft lift crop slope was determined as 0.07 per degree. So the delta alpha takeoff is actually delta alpha 2D with SF by F and cos lambda H multiplication. So we have put the numbers here for your convenience and now you should pause the video and do the calculations for the value of delta alpha during takeoff that number is 4.8 degrees. So what it basically means is that the presence of the flaps of this particular area ratio of a particular area and a particular sweep of the hinge line effectively results in increasing the angle of attack of the aircraft by 4.8 degrees that is the meaning of this calculation. Effectively when you deflect the flaps you get the increment in CL corresponding to what you would get if the aircraft had gone for an angle of attack increase of 4.8 degrees. So therefore the CL max flap will be the slope of the lift curve slope of the aircraft DCL by D alpha times whatever is the maximum angle of attack that you can operate plus what is the additional effective angle of attack created because of the flap deflection. So that number is 0.07 into 14 plus 4.8. 14 degrees as I mentioned is the maximum angle which is usable during takeoff and landing both in takeoff and landing and 4.8 is the effective increase in the angle. So the CL max is going to be 1.32 in the case of the takeoff condition. Let us repeat the same calculations for the landing condition. During landing the geometrical parameters actually remain the same the only change that happens is that the angle of attack 2D at landing because of the flaps in landing configuration is slightly higher because flaps are more effective in landing. So therefore we have the same formula delta alpha landing will be delta alpha 2D times SF by S and cos lambda H. The values of SF by S and cos lambda H remain the same as previously. This number was 7.5 earlier now it is 11.5. So you can simply calculate this value by dividing the previous delta alpha of 4.8 by 7.5 and multiplying by 11.5 or you can just do this calculation of multiplying these three terms the value comes out to be 7.4 degrees. I hope you are pausing the video and doing the calculations yourself. Once again the CL max of the flap aircraft is going to be the lift curve slope of the whole aircraft into the maximum usable angle of attack and the additional angle created by the flap deflection. So 0.07 is the lift curve slope of the entire aircraft with the effect of strike, effect of tail, effect of wing included. 14 is the maximum angle of attack absolute angle of attack that is available and 7.4 is the increment in the angle of attack effectively due to landing. So with this the value of CL max during landing comes out to be 1.50. Now let us just see what is the difference between our estimates and the data which is quoted in the source. So for comparison purposes we have utilized the data given in the book by Brands, Stiles, Burton and Whitford. So the first parameter is the lift curve slope. They have quoted the value of that as 0.1 whereas we have estimated the value to be 10 percent higher of 0.11. This is for the aerofoil itself. Now if there is a difference in the aerofoil lift curve slope itself obviously the numbers are going to change for the parameters that follow. So it is no surprise that the aircraft lift curve slope also comes out to be around 8 percent higher than the quoted value of 0.065. This is the value that is the actual value for the aircraft as quoted in the textbook. Then the maximum lift coefficient we have estimated 1.32 whereas the the quoted value is 1.27. So there is a 4 percent difference in the estimated value and the quoted value and at landing we have estimated the lift coefficient to be 1.5 whereas the value given is 1.43 so there is a 5 percent error. In other words if there is a fundamental error in the basic aerofoil lift curve slope itself then we expect these errors to come but still we are actually very much comparable to the value quoted in the literature. I would like to acknowledge the items I have borrowed from the book by Brandstiles, Burton and Whitford. I also would like to thank Daniel Rehmer for his seminal textbook on aircraft design from where also we have drawn some information and last but not the least I would like to sincerely thank my teaching assistant Naman Abdin for help in creating this tutorial. Thank you.


Your Coca-Cola bottler presents Claudia based on the famous play and novels by Rose Franken Brought to you transcribed Monday through Friday by your friendly neighbor who bottles Coca-Cola Relax and while you're listening refresh yourself. Have a coke and now Claudia Everybody ready. I'm ready. I'm ready to remember in my house ready means hands washed Here come here is come hands is washed table set lights on David Did you set the table at your job?  No, where the salts and peppers mama? Oh, oh Table isn't set. Oh, oh, it'll be set in a moment. Honestly. I can't depend on David for anything Hardly am I being maligned? Oh, that's such a pretty word. Yes, you are being whatever it is Here David if you can stand the weight take out the salts and peppers take them out to the ball game Yes, take them out of the dining room table with no funny business. No funny business. She says. Oh Chirp chirp. Claudia. Would you like a little salt?  I thought you said dinner was ready, Mrs. Brown I know better than to have dinner ready when I say it's ready And what does that mean it won't be ready for another 15 minutes? Oh, that's the only sure way I have of having you and the table ready at the same time David We have been hoodwink hoodwink. We'll have to get even with her grandma Are you treating us with psychology for the same price now shoe out of here mama has a glint in her eye darling We'd better leave her to her boiling cauldron. Mama. Do you want to go back to your boiling cauldron? I do. Oh, can't we help certainly you can help by staying out of the kitchen. Hey mama. Mama What are we having for dinner? Ham baked ham baked ham. Oh, well, I'll uh, I'll have to go into the kitchen and supervise What can I taste with my finger mama your finger? Somehow I don't think we're wanted in the kitchen David. I can't understand it Claudia. She called us to come I heard that I heard it now. She's changed her mind about it. I feel like an orphan in a storm Oh, you would only get out into the store. Oh, she means business. I'm certainly glad mama didn't treat me like that when I was young I would have gotten maladjusted. Well, it's never too late. Darling. If you set your mind no safe on that score here Don't forget the salts and peppers. All right now. Let's work this out. You take the salt Claudia I will take the pepper. We are boiling boiling down. We are beasts of boy come on beat We'll leave mama alone reluctantly reluctantly. I go why this should have happened to me There there is the pepper there is the salt That was a hard job Well table set now, what do we do back into the kitchen? There man, I'll read the evening paper. Oh, no, there's not time for that. It's only ten more minutes till dinner. I Know what? No, no, no, no, no, not that.  Oh born that way. She can't help you step across this threshold Boy, you're sprinkling it with pasta. Oh, you'd be so good Do want to be helpful David can fix the latch on the front door. I don't believe it's broken mama I think it's just a decoy. Isn't dinner ever going to be ready. What's the matter with the latch mama the door squeaks? Oh on On to the latch. Oh that latch it never works. Oh I hate to be a door what it's all life Open and close open and close. Oh, but you ought to know how that is Squeaks all right Squeak now and then it's nice It has character. Well, what about the latch? Is it broken What's the matter with it I Don't think you really know of course. I know is it's not working you are brilliant nurse nurse get me the scalpel Yes, doctor and the force and the retract. Yes, doctor nurse. Yes. Oh We are going To operate operate Will the latch live who knows who knows mama David wants to scalpel the force it's in the retractors David wants what the doctor is going to operate on the latch. Just pass me the instruments We are Mama give me the instrument boxes on the shelf behind it Good thing. I don't believe a word you say or I'd feel positively unwanted How's the ham coming? Wouldn't have such a temperamental ham in my house David here the instruments David Where are you here? I am Well, where is here? I'm out in the hall. Well, that's a fine place to be come on in Just open the door Richard You mean you're locked out in the door wait a minute wait a minute my hands are full of things Now David Hey, take your hand off the door knob. I can't turn it My hands are on the door knob. I don't believe you look through the keyhole. I am oh What a great thing are you have grandma? Hello, I said hello, honey with just one eye What do you see of me? Oh, open the door. I can't the knob is stuck You're going to have to spend the rest of the night out in the hall. I don't believe that the knob is stuck We'll have to feed you through the door. Oh, tell me what to do darling Let me see now wait a minute. Yes, I have it See if you can wiggle it into the keyhole get your eye out. I don't feel anything Why why did I have to marry so unmechanical a woman every time you start fixing something it unfixes and we get in a pretty fix oh I'm just killing me David, you know, I don't think you're mechanical either Hold everything mama, we've lost David That's an idea Wait a minute. Wait a minute. Yes Yes Yes, I get you I get you now I don't know my own strength and difficult journey. It's good to see you back. Oh, you're looking Sausted huh welcome again You said you give me something if I let you back into the house. Yes, I did Turn around. Oh, no, no, no, not that I get my hands on you She practically broke down the door is dinner almost ready yet another five minutes five minutes I think I'll get locked out again. I'll help you. No, thanks No, mama Is there anything else that you would want me to fix around the house while I'm waiting? I wouldn't let you touch anything. I want toast in my dinner. You can't have it Because the toaster doesn't work right I Thought so and what is the matter with the toaster get that look out of your eye David you're not to touch it the little thing in the jig jumps when you pull out jiggers. You don't say is that all is wrong? I'll never get these popovers down if you don't get out of here David push down the jiggers. Give me a piece of bread. Let's see what's the matter with this Give me a heel any heel No Down it goes Working fine Doesn't look as if there's anything the matter with it. Does it? No, I think every toaster should be dropped on its head every so often Oh Toaster through the bread out. Yes, it flew through the air with the greatest of ease It fell into the batter for batter or for worse the bread knows on which side it is battered Look at it swimming around to the rescue. We're like David. Don't you dare put your hand on it?  Oh Sees to me dinner was ready 15 minutes ago Stunt bad if I say so myself. I'm starving quick.  There you are. Oh It's nice being Smug I am smug and proud of it. I don't see why you didn't have anything to do With a ham smug about lots of other things We have a house in the country house in New York and now you're calling my apartment your I am Broken lats squeaky door nervous toaster all our and Mrs. Brown We hope we sincerely hope that you will call our house your home to mom Thank You David.  No chance of that darling one moment.   Isn't it? It is it is it certainly is Congratulations Claudia congratulations Claudia. Thank you David. Thank you mama Thank You God These are good sandwich and salad days Know what goes good with sandwiches and salads you guessed it ice cold coca-cola a bottle That's beaded with frosty pearls a bottle that helped you enjoy the pause that refreshes Treat yourself lady. You deserve it Make lunchtime refreshment time by including delicious coke this very noon time. Mr. King Have you had dinner yet? Just on my way, Mrs. Brown sure you won't drop in for a bit with us Well, I'm sure I'd better get on home. Thank you anyway not at all. Mrs. Brown before you leave tell me How's the baby? Oh Bobby? He's very fine knock wood.  He's going to be presented presented to Roger Killian. Oh My oh, I hope he behaves the baby. I mean the baby, of course Well, you'll see you'll see and by the way be sure you're around because David and Roger get into a pretty good discussion About the baby's education See you then Mrs. Brown Every day Monday through Friday Claudia comes to you transcribed with the best wishes of your friendly neighbor who bottles coca-cola So listen again tomorrow at the same time And now this is Joe King saying or a bar and remember Whoever you are Whatever you do Wherever you may be When you think of refreshment think of coca-cola For coca-cola makes any pause the pause that refreshes and ice-cold coca-cola is everywhere These broadcasts are adapted for radio by mania star and the entire production is supervised and directed by William Brown Maloney and now here's a word from your friendly neighbor who bottles coca-cola


Okay. So hello everybody. I am Dimitri Fontaine from France and we're going to talk about backups. And actually we're going to be speaking about why backups are not interesting. Let's get back to that in a minute. So I'm currently working at a French place called Le Boncoin which is doing a classified ads. And I've been a major contributor for PostgreSQL for sometimes now. The current project that I spend my free time hacking on currently is a PG loader. The goal of PG loader is to be able to load data into PostgreSQL as fast as possible. And the trick that doesn't show in the name of it is that it will, for example, load data from a MySQL database. To connect to MySQL, introspect the schema by doing catalog queries, recreate an equivalent schema in PostgreSQL including data type conversion. For example, tiny int of one might actually be a Boolean so it will take care of that. Do the rule data loading and then recreate all the indexes, the constraint, etc. So you can do a full blown MySQL to PostgreSQL migration in one command line. And it works also with a SQL server, SQLite, and CSV, DBase, plenty of things. So check it out if you have a use case for it. Yes, sponsor me and I do that. I'm serious. I'm not going to touch your record on my free time. That will never going to happen. But I really want PG loader to have a record support. So let's talk about it. I'm serious. So I've been doing other stuff for PostgreSQL. If you're using DBian, check out APT.PostgreSQL.org. DBian has a policy that is really good but that work against PostgreSQL in this time, which is that they really want to be able to maintain the software, whatever happens. So they're on the hook to fixing the bugs, which means that they don't want to include all currently supported PostgreSQL releases. And in DBian, DBian stable, that doesn't mean the software distributed by DBian is stable. It does mean that the version number of every software doesn't change during the lifetime of the distribution. So it's not the software that is stable. It's the couple software name, version number. So if they have PostgreSQL 9.1, they will not have 9.2, 9.3, etc. They only have one version. If you want to have a stable PostgreSQL release on a DBian stable distribution and if you want to have the opportunity to choose whichever of the five currently stable PostgreSQL releases you want to work with, check out APT.PostgreSQL.org. Okay, so as I said, backups are not interested, interesting at all. So who is running PostgreSQL in prediction? Yeah, who's doing backups? Who's doing automated tested recovery? The other ones, you don't have backups. End of story. That's it. If you don't test the backup, the only way you know you have a backup is that you're able to restore it. Okay, there is no use case for a backup other than recovering. If you don't try to recover a backup, you don't know if you have a backup. If you don't know if you have a backup, well, you don't have a backup. That's it. So that's my full talk. So backups are used in general because you want to be sure that whatever happens, you still have access to the data. So that's the disaster recovery plan. When everything, every other things are failing, all one after the other, then it's time to recover a backup. And if you didn't, if you don't have automated tested of the backups, so the recovery actually, well, the day you really need them, you don't have a procedure. You don't have a script that does it automatically. You don't have people trained to do it. So you're discovering how to risk to recover a backup for the first time. And you're in that situation. That's not good. Nobody wants to be there. So don't be there. So my advice is that never ask people to do backups because they will do they will do backups and they will stop there. And that's not what you want. There is no business that just want backups. So task task people to do automated recovery each and every day, week, whatever is makes sense for you. So for example, you do physical backups each and every night. Let's get that as an example. And how do you test your physical backup? Well, you copy it over to a box where you start PostgreSQL and PostgreSQL should be happy to start with whatever files. Wearing the physical backup, right? And then you PG dump out of that standby that you just bring down from the backup. And PG dump will read every piece of data into PostgreSQL. So it will actually test that you can read all the data that is part of the backup. And bonus, you will have a physical backup and the logical backup. And the logical backup is not hammering any resource on your production server. So just do that. Physical backup fully automated and then you restore that, you PG dump out of it. And if you really want to be sure, you also vacuum the whole thing because PG dump will not use the indexes. And maybe you want to test that you can actually read data from the indexes. So you can also vacuum at a standby, you just bring it out from the backup. So you don't do backups. You do automated recovery testing. And one of the good tools that you can use to be able to do that is Barman. So why Barman? Barman is the only tool I know of. I need to check about PG Backrest about that, but David will tell me. Up to now, Barman has been the only tool that I know of that explains. The first thing he says, Barman is not a backup tool. Barman is a disaster recovery tool, okay? The aim of Barman is to recover data. The guys who wrote the software, what they want to be able to do is recover data. That's what you want. Backrest, you have that too. It's all about the recovery. Okay, so you can use either Barman or Backrest. The other ones, each time they're talking only about the backups. We're really good at doing backups. Nobody cares, whatever. So I'm not really sure I succeeded into convincing you to change all your backup organization and procedures, etc. So let's talk about a story that did happen when I was called in the early morning to help fix a customer who had a problem with their backups because they never tested it. So they did not have any backups. And still they lost data and prediction. So let's see what happens when you lost your data and prediction. You have no standby and you have no backups. What's next? You can close the door, find a new job, I don't know, something. So that's another favorite of mine. We do have backup. We have written a shell script. What can I say? Never use shell in prediction ever. In prediction, the only important thing you want to be able to do is recover from any error that you didn't think about. So you need to use a tool that allows you to implement error handling. How do you handle errors in a bash script? Well, you don't. So don't use bash in prediction. That's it. Whatever you want to, but you need to be able to handle non-anticipated errors. That's prediction that will happen and it needs to be graceful as graceful as possible. There is no way to do it correctly in a shell script. So if you have shell scripts in production, rewrite them in something else. Maybe not just now, but tomorrow. I'm quite serious about it. Each time there is a huge fuck-up in prediction, there is a shell script somewhere. So in that case, the shell script was all about caring for backups. So it was a backup script. The first thing they did, obviously, is to make sure you have enough space on the device to actually make a backup. So the first thing you do is you remove the old backups that are still laying around. So every file that is older than five days gets removed. And of course, this is a Chrome job that runs as the progress user on the machine. I think you're seeing it coming, but let's spell it out nonetheless. And they were under pressure to deliver this system. So they didn't do all the checks that the setup was entirely correct. And they forgot to include the environment that contains the backup there. So what happens? That directory doesn't exist. So that actually will happen in the currently working directory. And if you're in the Chrome context as progress user, that's PGData. So let's remove any file older than five days in PGData. And then we'll take a backup. Yeah. Okay. Who's running backups from a shell script in production? Yeah, I changed that. Yeah. Don't do it anymore. Okay. So if you can spell that at loss, that's what happened. So let's see about what to do now. Don't do it. Yeah, don't try to do it. So they did have some work archiving. But they didn't have a pass backup that matches the wall stream. Because the pass backup was supposed to be taken by the shell script. But the wall archive, it was the archive command in the PostgreSQL.conf. That was deployed. The environment, no, but that part, yes. So we were like, okay. So let's try and use those wall files that are beginning at the, just the beginning of the server. We don't have a pass backup, but when you start your server for the first time, you just need an initdb. It's here, initdb. And then you start. So any server on the same physical architecture begins all the same every time. It always begin as like the result of the initdb command from the same version of PostgreSQL. So we did that. And we tried to apply the wall with the restore command to the resulting cluster. Like the bare default cluster. But of course, the wall files contain the system identifier that is randomly generated each time you do initdb. So it didn't match. Okay. Let's see in the wall what is that number, that magic number, and replace it into the, replace in the current initdb system. Change the system number with that. So the system number was this one that I will not even try to read. And it's written that way. It needs to be written in hexadecimal, of course, because it wouldn't be fun otherwise. And network byte order, which means that you begin by the end. And so with exedit pgcontrol file to put that into place at the right of set in the file. Don't mess it up. But it's in the new initdb cluster. So if we mess it up, we don't lose any data. We do initdb again and try again. So we do that, and then we try again to apply the wall files. And this time we have no system identifier ever. So it means that we managed to bring in the correct identifier. But of course, the procedure to install a new server will first do the initdb and then change the setup to include the wall files and then start again the server. So we're missing the first wall file, the first two of them actually. So there is no way we can invent them. No luck. So we couldn't apply the wall files we had. We were missing the first ones. If we had a base backup, we would have been able to use them. We didn't have a base backup. And there was no way to reconnect with the initdb sequence. So too bad. What's next? Just to be sure, who wants to do that in production where any other hope is lost? You don't have any data left. The data is really important. That was financial transactions. I'm serious. So they really wanted to recover the data. They have nothing left. And we're doing that in production with every manager having pressure on his head because they lost the financial data to report to the customer and invoice the customer. So who wants to be doing that in production? Yeah, do your backups. Test your recovery. Do the recovery. Yeah. But we don't have the data yet, so we continued. So we're going to act on whatever is left from the rm-ref that we did before. So whatever left, we're going to act on that and try to have PostgreSQL be able to start with something. So first, make a copy. Don't destroy it again. We're going to act and we're going to do bad things on the data. So whatever left, we work on a copy. That's obvious, but given that the backup script failed and removed the production data, maybe we need to state the obvious. So when we start PostgreSQL against the copy of this data set, well, there is no pg-file.map file. So in PostgreSQL, when you create a relation, like a table, an index, a sequence, lots of things, it will be assigned a numeric name that is the name of the file on disk and which might be the same as the internal identifier or maybe not. So there is a mapping in between the internal PostgreSQL identifiers, the OIDs of the catalog table. There's a mapping in between that and the name of the file on the file system. So that's the map of the file nodes for PostgreSQL, pg-file node, which we didn't have, so we recreated it with that magic command. Yeah, so I had some help to figure that out. It was an address friend. I asked him and he was like, oh, that's easy. You just do that and you have one. You can play with it. Okay, let's try that. It worked. Next problem. So now we have a pg-file.map file and PostgreSQL refuses to start nonetheless because it's missing some clogged files. So the C log, okay, so it finishes with the log. So some people, when they short of space on some directory and they're like, okay, let's remove some useless files. Oh, there is a whole bunch of log files that are written in binary and that nobody can do anything with it. Let's remove that. It's taking lots of places on disk. So it might happen to you even, yeah, it happens. So there is log in the name, but don't ever remove that. The C log is the state of each transaction on disk. It will tell you for each transaction number, XID, if it did commit or rollback, which means if you don't have that file, you don't know if the data is visible or not. So at this step, we're going to hack the file, create them again. And so there is two bits per transaction. So you have three different states possible, and the 01 state means visible. So we're going to hack the C log files, create them again, and placing the big U here means 01 because we have four transactions visible, if you say big U. And so we are creating the missing C log files and we are pretending that every reference transactions in those files were committed and not rollbacked. We don't know that. We don't know that. Maybe some of them had a rollback and so we are going to make data visible that was not visible. So at the end of the story, we get some data back to the analysts and they're like, yeah, but that transaction, I'm not sure it did happen. Yeah, maybe not because we did that. We don't know. So we needed to do that for PostgreSQL to start, but we're not lying about any data that we may recover. No PostgreSQL is starting. So it starts. It's great. So you connect to it. And no, you cannot connect to it because the first thing it says is there is no PG database file. Okay. So let's create one. What is a PG database file? So we need to be another cluster on the side and we connect to it and have a look at PG database and it is what it looks like. So remember about the file node mapping that we had before. So we need another mapping for the database entries. And because it's a shared catalog, it needs to be there whatever the database you want to connect to. This file exists for the whole cluster. So it doesn't depend on the database. So you need to have it to be able to connect. To check that you, when you connect, PostgreSQL needs to check that the database you want to connect to exists. And it does that in that file. And that file was older than five days. So it's been lost by our backup script. Okay. Just so that we are on the same page. So if we try to figure out that binary content of the file, we can see that you recognize the strings here, right? That's the names of the database. So let's create a file with the mapping we need. So we can't inject anything in the cluster because there is no way we can start the cluster. So what we did is hack PostgreSQL source code so that we would have a with OIDs option for create database. So now with that command in the server, we are able to create the database and specify the target OID we want. Because we had the files. So each database here is mapped to a directory that lives into base inside the main cluster. Those files, those directory entries still existed. And the name of the file is all numeric. And that is the number we want here inside. So the content here, the relation file not entry. We know that data is just ls in the base directory and you have the numbers. And we found the script that they used in the shell history. I'm not even kidding. So in the shell history of the box where they lost all the data we could find in which order they created the database like when they put the box in production days ago. And so we could map because it's an increasing sequence so we knew which number would be which database. So now with that command we could log into so we could create a new cluster, hacked with a new command and create the database in the same order again and pick the OIDs from the ls of the damaged cluster. And when we have that we can copy over the file with the mapping and now we can actually connect to PostgreSQL. Yeah. But it's not done yet. So just as a quick reminder, either you do that or you have proper backups that you test. Okay. But let's have fun some more. So now we want to connect to a database and well, I was not at ease at this time because as the consultant to help them I read an error message that I didn't know existed. I had to open the code of PostgreSQL again and try to find it and try to understand what it is. So who has seen that error message before? Peter maybe. No, not even you. So what does it mean? Well, the PG database file, so the mapping in between the numbers and the name of the databases, PostgreSQL has that now. So it can open the file. It's happy so it can start. But when you try to use it, so as it's a shared catalog it's indexed because you need that pretty often. So PostgreSQL will actually read the data from the index, not from the file. So we created the file with the right mapping but it will not use it anyway. But PostgreSQL hackers are really, really, really good about that. So of course you can start a PostgreSQL cluster and with this option tells the PostgreSQL cluster please refrain from using any system catalog index. And every PostgreSQL feature will continue to work, just disabling the indexes, the system catalog indexes. Because of course you're going to have problems with that and the hackers did know about that so there is a mechanism that allows you to fix the system catalogs. You can re-index them and whatever. So the full thing is, once you start it you don't want the... What we want to obtain from this scenario is whatever data is still available in the damage cluster. We don't care about doing anything. So we disable all the index usage for later and we disable the system catalog indexes. We reload with the new config and not only PostgreSQL starts but we can connect to it now. So is there any data in there? The first thing we do when we connect of course is please PostgreSQL list me the tables that you do have. And it's like, oh I would like to but I'm missing that file. And in the fresh cluster that we did in IDB on the side we see that the file exists and it's PGPROC. So each time you create a database a series of files are created, same with the same OIDs extra. So the OID and the PGPROC file node here are always the same if you do an IDB again. For the same version of PostgreSQL it's always the same numbers. So we missing here PGPROC. And when you do backslash DT to have the list of the tables the query that is used to do that actually uses some functions stored procedures. So you cannot list the tables because you have lost all the stored procedures. But they are available in the binary of the PostgreSQL cluster. So the binary has them but they are not available in the PostgreSQL catalogs. So they're not available at the SQL level. So well we copy the file over, the PGPROC file directly we copy it over from the fresh IDB system to the dmg cluster and we were really lucky on that recovery scenario they didn't use any stored procedures. So when we do that we just install all these standard stored procedures from PostgreSQL but none of the user defined one. But they did not have any so it's okay. So we do that. Well PostgreSQL is running, we copy over the PGPROC file and we try the command again and it works. So that's pretty amazing. But now it's complaints about schemas. So let's continue to dive into that. Either that or you have backups, you know. So here is what the namespace is. So it looks like that. So it's the list of the schemas that you have. So again they only have a couple, maybe three schemas and they did remember about them which order extra. And actually we didn't really care, we could have renamed them whatever we wanted. But there is a trick. They don't have the PG namespace file but they, so here is what it looks like if you copy it out from a working system. So the goal is to create a new file that looks like that and copy it over the damage cluster. So we copy PG namespace from standard input with ideas and we say okay, we had a neural message that this idea was unknown as a namespace. Well it's my namespace now and I own it and it has no special privileges and you can actually do that on a running cluster. And where are the numbers coming from? Well we were really lucky. We still have PG class. Basically they did create maybe a temporary table or something in PG class in the last five days. So the backup script that removes anything older than five days didn't get to remove that one. But during a create table command in the last five days we wouldn't have PG class to work with. So we were really lucky. And so in PG class we have the real namespace that is the OID of the namespace which is used as a foreign key. So of course if we need to do a left join because the namespace entries are empty. But we know the real namespace and we know the name of the table and they're like oh this table is part of this schema so it was the proper name of the schema. Okay so then we can prepare the command here and inject our namespaces so that PostgreSQL works again. And again we do that live so we do that copy command live into a broken cluster and we go to the next stage. It's pretty amazing. We can query the catalogs but what we want actually is not the catalog entries we want to recover whatever data is still available right. And so we have PG attributes again maybe they did create a table in the past five days so we still have PG class and we still have PG attributes. And PG attribute it's a good thing we have that because it's one of the most complex to recreate from scratch so we didn't have to do that. We don't have the attribute but we don't have the catalog with the attribute defaults value. So here is what it looks like the default values and if you look at the catalogs so you have one row per attribute with an attribute which is an add name so it's the list of columns with the first column number one second column number two extra and in the ATTRDef table we have the default value expression so now we need to step back a little and so the goal is to recover any data we're not going to insert new data into the damage cluster image right. So do we care about default values? No we don't we just want whatever is in there we're not going to invent new default values so let's pretend that there is no default value we have in PG attributes we have an ATT has default which is a column that allows PostgreSQL to know if it needs to go fetch the default value when you do an insert without the value and so let's update that and say no no there is no default so don't care about that okay so we don't need to fix that catalog that is missing we just pretend that nobody has a default value please okay and then after that we are able to copy the data over to CSV files so we could actually recover some data from that and remember about the C-LOG slide we could recover data but we don't know if the data we recovered had ever been committed or not no way around it so two days later when we did that then the guy complained you recovered some data that never existed yeah yeah so as a conclusion I was really really impressed by PostgreSQL resiliency here because I could start we could hack our way into the having the cluster start again and then while the while the thing is running we could fix it so if we back to the if we back a minute to the the PGPROC countries here so we did it was complaining about that file that is missing and it's PGPROC but it actually I didn't copy paste the slide but I could have copy pasted that like with dozen other catalogs that were missing to like PGAM the access methods PGOP families PGOP class PG anything that you will never modify in after modify after the create table so we lost any any file older than five days so that's the things you typically don't modify so we lost all the all the core infrastructure of catalogs for PostgreSQL so we did replace not only PGPROC but the dozen others again we were lucky they were not using extensions if you create an extension that is to those catalogs and it sentries that the object identifiers the ID are going to be dynamic so you don't know them in that case all the OIDs we have are created at any db time and those numbers are coded into PostgreSQL source code so from one installation to the other it's always the same number so we could pick all the files from a new system and copy them over not only for PGPROC but for lots and lots and lots of other catalogs so and we did that while the server was running so we type in the query, we have the new error message we copy the file over we type the command again and it's the next one so I was pretty I was really really impressed and at the end so we get the data and some data actually not all of it the recovered didn't existed in the production system but they could do something try to figure it out but I'm not even sure they lost the customer on that that's another story so as a conclusion who's doing backup in production who's having PostgreSQL in production like lots of, yeah all of you who's doing backups who's doing automated recovery testing the other ones you don't have backups remember about that and don't ever ever write a shell script to run in production because you will have cases that are not undult properly and you will for example remove any file older than 5 days in the wrong directory so just don't do that use a proven tool like barman or pgbackrest something serious that is all about recovery not backups nobody wants backups we want recovery any question yes most of the things like here that was pretty fast yeah that thing not so much so it took two days yeah two days I sleep at night so maybe twice 10 hours let's say 20 something before I started yeah yeah no no no no over there and then you the dba in charge called me on the phone over saying we really need you to come over now yes he did it was not so much like the boss that was really crazy that some of the data didn't exist actually he didn't have a clue what did happen and the sysadmin guy and the dba guys they didn't really want to explain to him the failure of the backup script so he didn't get a clue well I don't know it's a well the file did disappear so maybe it would have made things no I don't think it would have changed anything because we couldn't use the whatever world files we had and checksums are going to be in the world files we couldn't use that so I think it wouldn't have helped at all I think but I don't want to do it again just to be sure good question that must have been 9-1 no I don't know on that version no but if we had checksums I don't think it would have changed anything yeah I guess any other question thank you